home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Reference / the cmsp digests ('94-'97) / csmp digest Vol 3 No 133 < prev    next >
Text File  |  1996-01-27  |  90KB  |  2,402 lines

  1. C.S.M.P. Digest             Sat, 27 Jan 96       Volume 3 : Issue 133
  2.  
  3. Today's Topics:
  4.  
  5.         Checking for QuickTime
  6.         Creating aliases
  7.         Detecting <Option> + Double-Click
  8.         Drag & Drop - Why is finder different?
  9.         File I-O
  10.         First OS for Quicktime?
  11.         How to render DECENT 256 color sprites
  12.         Launching Application on Remote Mac CPU
  13.         MakeRGBPat Sucks (and how you can do better)
  14.         MoveControl Doesn't Change Dialog Item Rect
  15.         Newbie help with events....
  16.         Oh where has my CODE 0 gone?
  17.         The Required Apple Events (i.e. are they)
  18.         Turning on Sharing
  19.         [ANN] MoreFiles v1.4.1 now available
  20.  
  21.  
  22.  
  23. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  24. (pottier@clipper.ens.fr).
  25.  
  26. The digest is a collection of article threads from the internet
  27. newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and
  28. csmp.games. It is designed for people who read news semi-regularly and
  29. want an archive of the discussions.  If you don't know what a
  30. newsgroup is, you probably don't have access to it. Ask your systems
  31. administrator(s) for details. If you don't have access to news, you
  32. may still be able to post messages to the group by using a mail server
  33. like anon.penet.fi (mail help@anon.penet.fi for more information).
  34.  
  35. Each issue of the digest contains one or more sets of articles (called
  36. threads), with each set corresponding to a 'discussion' of a particular
  37. subject.  The articles are not edited; all articles included in this digest
  38. are in their original posted form (as received by our news server at
  39. nef.ens.fr).  Article threads are not added to the digest until the last
  40. article added to the thread is at least two weeks old (this is to ensure that
  41. the thread is dead before adding it to the digest).  Article threads that
  42. consist of only one message are generally not included in the digest.
  43.  
  44. The digest is officially distributed by two means, by email and ftp.
  45.  
  46. If you want to receive the digest by mail, send email to listserv@ens.fr
  47. with no subject and one of the following commands as body:
  48.     help                                Sends you a summary of commands
  49.     subscribe csmp-digest Your Name     Adds you to the mailing list
  50.     signoff csmp-digest                 Removes you from the list
  51. Once you have subscribed, you will automatically receive each new
  52. issue as it is created.
  53.  
  54. The official ftp info is ftp://ftp.dartmouth.edu/pub/csmp-digest.
  55. Questions related to the ftp site should be directed to
  56. scott.silver@dartmouth.edu.
  57.  
  58. -------------------------------------------------------
  59.  
  60. >From geoffprice@aol.com (GeoffPrice)
  61. Subject: Checking for QuickTime
  62. Date: 4 Jan 1996 15:12:23 -0500
  63. Organization: America Online, Inc. (1-800-827-6364)
  64.  
  65. Can anyone let me know what the correct way to check for the presence of
  66. QuickTime is, and save me the experimental hassle?
  67.  
  68. My old Think (PM v7) headers don't know about "gestaltQuickTimeVersion",
  69. so I'm passing 'qtim' to Gestalt as a literal.  I understand this returns
  70. a version number;  what's the format of this version number?  (e.g.
  71. 0x0200?)  
  72.  
  73. What does it return if QT is not installed (0?)
  74.  
  75. Thanks
  76. Geoff Price
  77. Intellimation / Caliban Mindwear
  78. GeoffPrice@aol.com
  79.  
  80. +++++++++++++++++++++++++++
  81.  
  82. >From rgaros@bio.vu.nl (Rene G.A. Ros)
  83. Date: 6 Jan 1996 19:54:19 +0100
  84. Organization: VU Biology, Amsterdam, The Netherlands
  85.  
  86. GeoffPrice (geoffprice@aol.com) wrote:
  87. : Can anyone let me know what the correct way to check for the presence of
  88. : QuickTime is, and save me the experimental hassle?
  89.  
  90. : My old Think (PM v7) headers don't know about "gestaltQuickTimeVersion",
  91. : so I'm passing 'qtim' to Gestalt as a literal.  I understand this returns
  92. : a version number;  what's the format of this version number?  (e.g.
  93. : 0x0200?)  
  94.  
  95. **NumVersion**
  96.      The format of the LongInt response can be coerced into type NumVersion,
  97.      which is the same format as used for the 'vers' resource type.
  98.  
  99.      type
  100.       NumVersion = packed record
  101.        case INTEGER of
  102.         0: (majorRev: SignedByte;  {1st part of version number in BCD}
  103.             minorRev: 0..9;        {2nd part is 1 nibble in BCD}
  104.             bugFixRev: 0..9;       {3rd part is 1 nibble in BCD}
  105.             stage: SignedByte;     {stage code: dev, alpha, beta, final}
  106.             nonRelRev: SignedByte);{revision level of non-released version}
  107.         1: (version: LONGINT);     {to use all 4 fields at one time}
  108.        end;
  109.  
  110.      stage is one of: 0x20 = development
  111.                       0x40 = alpha
  112.                       0x60 = beta
  113.                       0x80 = final
  114.  
  115. : What does it return if QT is not installed (0?)
  116.  
  117. Nothing, the selector isn't installed and you get an error back fromthe
  118. Gestalt call (gestaltUndefSelectorErr).
  119.  
  120. Bye,
  121. Rene Ros
  122. Editor Gestalt Selectors List (use URL below to see it online)
  123.  
  124. -- 
  125.   Rene G.A. Ros                                               rgaros@bio.vu.nl
  126.   Amsterdam, The Netherlands                 http://www.bio.vu.nl/home/rgaros/
  127. - ------------------------------------------------------------------------------
  128.   HAPPY NEW YEAR!                                          GELUKKIG NIEUWJAAR!
  129.  
  130. +++++++++++++++++++++++++++
  131.  
  132. >From erichsen@pacificnet.net (Erichsen)
  133. Date: Sun, 07 Jan 1996 07:37:09 -0700
  134. Organization: Disorganized
  135.  
  136. GeoffPrice (geoffprice@aol.com) wrote:
  137. > Can anyone let me know what the correct way to check for the presence of
  138. > QuickTime is, and save me the experimental hassle?
  139.  
  140. Get DTS QuickTime Utilities. It's a bunch of utility routines by Apple DTS
  141. for QuickTime. It has a routine that checks if QuickTime is installed and
  142. gets its version, checks for QuickTime Musical Instruments, etc...They
  143. work correctly on a PowerPC too. It's on Apple's site.
  144.  
  145. ---------------------------
  146.  
  147. >From tomlinso@brigid.ucr.edu (John Tomlinson)
  148. Subject: Creating aliases
  149. Date: 4 Jan 1996 04:57:22 GMT
  150. Organization: University of California, Riverside
  151.  
  152. I'm writing a program where I can drag from an application window to
  153. the Finder, and creating an alias if the drag succeeds.  I've finally
  154. gotten it to the point where the drag doesn't bounce or cause the
  155. application to crash, but the "aliases" created are weirdly broken.
  156.  
  157. Here's a code snippet to illustrate my method:
  158.  
  159. (snip)
  160.  
  161. NewDrag(&drag);
  162. itemRef = (ItemReference)myPort      // "myPort" is a GrafPtr used by
  163.                                      // my app
  164. promiseHFS.fileType = 'adrp';
  165. FSpGetFInfo(&fileSpec,&finderInfo);  // "fileSpec" is a FSSpec variable
  166.                                      // used by the app to store a link
  167.                                      // to an application
  168. promiseHFS.fileCreator = finderInfo.fdCreator;
  169. promiseHFS.fdFlags = kIsAlias;
  170. promiseHFS.promisedFlavor = flavorTypeHFS;
  171. AddDragItemFlavor(drag,itemRef,flavorTypePromiseHFS,&promiseHFS,
  172.         sizeof(PromiseHFSFlavor),0);
  173. AddDragItemFlavor(drag,itemRef,flavorTypeHFS,nil,0,0);
  174. SetDragSendProc(drag,SendDataProc,(void *)(&fileSpec));
  175.  
  176. (rest of drag stuff snipped)
  177.  
  178. And here is "SendDataProc":
  179.  
  180. pascal OSErr SendDataProc(FlavorType type, void *dragSendRefCon,
  181.         ItemReference itemRef, DragReference drag)
  182. {
  183.  
  184. (snip)
  185.  
  186. if (type == flavorTypeHFS)
  187. {
  188.         dataSize = sizeof(PromiseHFSFlavor);
  189.         GetFlavorData(drag,itemRef,flavorTypePromiseHFS,(Ptr)&promiseHFS,
  190.                 &dataSize,0);
  191.         flavorHFS.fileType = promiseHFS.fileType;
  192.         flavorHFS.fileCreator = promiseHFS.fileCreator;
  193.         NewAlias(nil,(FSSpec *)dragSendRefCon,&alias)
  194. // also tried "NewAliasMinimal" here
  195.         FindFolder(kOnSystemDisk,'temp',kCreateFolder,&vRefNum,&dirID);
  196.         name = ConcatString(((FSSpec *)dragSendRefCon)->name,"\p alias");
  197. // "ConcatString" merely concatenates two Pascal strings and returns the
  198. // new string.  Seems to work.
  199.         FSMakeFSSpec(&fileSpec,flavorHFS.fileCreator,flavorHFS.fileType,
  200.                 smCurrentScript);
  201.         HGetFInfo(vRefNum,dirID,name,&finderInfo);
  202.         finderInfo.fdFlags = flavorHFS.fdFlags;
  203.         HSetFInfo(vRefNum,dirID,name,&finderInfo);
  204.         FSpCreateResFile(&fileSpec,flavorHFS.fileCreator,flavorHFS.fileType,
  205.                 smCurrentScript);
  206.         FSpOpenResFile(&fileSpec,fsWrPerm);
  207.         AddResource((Handle)alias,'alis',128,"\p");
  208.         WriteResource((Handle)alias);
  209.         flavorHFS.fileSpec = fileSpec;
  210.         SetDragItemFlavorData(drag,itemRef,flavorTypeHFS,&flavorHFS,
  211.                 sizeof(HFSFlavor),0);
  212.         FSpDelete(&fileSpec);
  213.  
  214. (snip)
  215.  
  216. This procedure creates a file which in some respects acts like an alias.
  217. It contains an 'alis' resource, it has the correct type and creator.
  218. When double-clicked, it launches the app, but not as an alias, I think--
  219. as a document of the app.  Hence, if I create an "alias" to (say)
  220. DropStuff, I'll get a dialog box asking me if I want to save 
  221. "DropStuff.sit" (i. e. if I want to compress my "alias".)
  222. The "alias" has a generic document icon, and when I check it with
  223. ResEdit, the "is Alias" bit is turned off (sometimes.  Occasionaly
  224. I obtained "aliases" with the bit set.  However, when I double-clicked
  225. these "aliases", I get a dialog box saying "this isn't really an
  226. alias (oops!)")
  227.  
  228. Apparently the 'alis' resource is corrupt, but how?
  229.  
  230. - John
  231.  
  232. tomlinso@engr.ucr.edu
  233.  
  234. +++++++++++++++++++++++++++
  235.  
  236. >From jumplong@aol.com (Jump Long)
  237. Date: 5 Jan 1996 11:27:44 -0500
  238. Organization: America Online, Inc. (1-800-827-6364)
  239.  
  240. John Tomlinson wrote:
  241. >I'm writing a program where I can drag from an application
  242. >window to the Finder, and creating an alias if the drag
  243. >succeeds.  I've finally gotten it to the point where the drag
  244. >doesn't bounce or cause the application to crash, but the
  245. >"aliases" created are weirdly broken.
  246. > Here's a code snippet to illustrate my method:
  247. >
  248. >(snip)
  249.  
  250. The problem in your code is that your don't set the isAlias Finder flag.
  251. That's what tells the system that the file is an alias file instead of a
  252. just a data file.
  253.  
  254. Also, when creating the alias with NewAlias to put in an alias file, you
  255. should set the fromFile parameter to NewAlias to refer to the alias file
  256. itself. This will make your alias files more robust because when the
  257. Finder resolves an alias from an alias file, it uses an FSSpec to the
  258. alias file as the fromFile parameter passed to ResolveAlias.
  259.  
  260. Actually, what I should be telling you here is you should send the Finder
  261. an AppleEvent to tell the Finder to create the alias file. Letting the
  262. Finder create the alias file is a much more compatible way to create alias
  263. files since you won't be depending on how the Finder creates alias files
  264. now.
  265.  
  266. - Jim Luther
  267.  
  268. +++++++++++++++++++++++++++
  269.  
  270. >From Jeff Pritchard <jeffp@inow.com>
  271. Date: Fri, 05 Jan 1996 18:48:59 -0700
  272. Organization: NSI/INOW
  273.  
  274. if you use the finder to make an alias of an application and then 
  275. use resedit to get the file type of the alias file (use the open 
  276. command and click on the "use alias instead of real file" checkbox) 
  277. you will see that the finder does something different with aliases 
  278. (aliiiiii?) of applications.  Instead of copying the file type of 
  279. the application (APPL), it uses  'adrp' for the file type.
  280.  
  281. If you set your file type to adrp, I think you will find that the 
  282. aliases you are creating will work fine.  Mine do, and they are 
  283. created in a manner functionally equivalent to your method.
  284.  
  285. ---------------------------
  286.  
  287. >From lyntaro@zoom.com (Totoro)
  288. Subject: Detecting <Option> + Double-Click
  289. Date: Wed, 03 Jan 1996 12:45:39 -0700
  290. Organization: Vega
  291.  
  292. Is there any way I can detect a different mode of launching an
  293. application? For example, if a user launches an app while the user is
  294. pressing the <Option> key, how do I trap it?
  295.  
  296. The reason is that my application might want to provide two execution
  297. mode, one is normal one with menus and windows, but in other mode I want
  298. the same app to do certain operations automatically.
  299.  
  300. Thanks,
  301. Totoro
  302.  
  303. +++++++++++++++++++++++++++
  304.  
  305. >From pyared@idsinc.com (Pete Yared)
  306. Date: 4 Jan 1996 00:10:41 GMT
  307. Organization: Interactive Data Systems, Inc.
  308.  
  309. In article <lyntaro-0301961245390001@lyntaro-slip.zoom.com>,
  310. lyntaro@zoom.com (Totoro) wrote:
  311.  
  312. > Is there any way I can detect a different mode of launching an
  313. > application? For example, if a user launches an app while the user is
  314. > pressing the <Option> key, how do I trap it?
  315.  
  316. Use the GetKeys trap to check to see if a command key is getting held down
  317. when your apps opens.  This is consistent with the FInder since when you
  318. option drag to copy, the option key is checked when you finish the drag,
  319. not when it is started.  However, option is a bad choice for what you're
  320. doing because the Finder uses option double-click to close the folder the
  321. document/app is in after a launch.  I would recommend using command
  322. double-click instead.
  323.  
  324. Pete Yared
  325. Interactive Data Systems, Inc.
  326. Washington, DC
  327. E-Mail: pyared@idsinc.com
  328. WWW: http://www.idsinc.com
  329. Anon FTP: ftp://ftp.idsinc.com
  330.  
  331. +++++++++++++++++++++++++++
  332.  
  333. >From eric.kidd@dartmouth.edu (Eric M. Kidd)
  334. Date: Fri, 05 Jan 1996 17:21:38 -0500
  335. Organization: Dartmouth College
  336.  
  337. In article <lyntaro-0301961245390001@lyntaro-slip.zoom.com>,
  338. lyntaro@zoom.com (Totoro) wrote:
  339.  
  340. > Is there any way I can detect a different mode of launching an
  341. > application? For example, if a user launches an app while the user is
  342. > pressing the <Option> key, how do I trap it?
  343.  
  344. You can't easily detect which keys were down when the user double-clicked
  345. in the Finder, but you *can* check the keymap just as your application
  346. launches. The following as-yet-untested snippet should return a bitfield
  347. identical to the "modifiers" field of an EventRecord. Even if it doesn't
  348. work as advertised, it should point you in the right direction.
  349.  
  350. //=========================================================================
  351. // • GetModifiers
  352. //=========================================================================
  353. // Return the current status of the modifier keys and mouse button, as
  354. // per the "modifiers" field in an EventRecord. We examine the virtual
  355. // keymap directly using low-level Event Manager calls, and call Button( )
  356. // to check the event queue for mouse-down events.
  357. //
  358. // See _Macintosh Toolbox Essentials_, p. 2-110, for documentation of
  359. // the function GetKeys and the data structure KeyMap.
  360.  
  361. static unsigned short ModifierCodes[] = {
  362. // Mask     Virtual Keycode   
  363.    cmdKey,     55,
  364.    shiftKey,   56,
  365.    shiftKey,   60,   // right-hand side of keyboard
  366.    alphaLock,  57,
  367.    optionKey,  58,
  368.    optionKey,  61, //   "
  369.    controlKey, 59,
  370.    controlKey, 62,   // "
  371.    0 };
  372.  
  373. # define BITS_IN_LONG   (32)
  374.  
  375. unsigned short GetModifiers( )
  376. {
  377.    KeyMap keyboardState;
  378.    short index;
  379.    short result;
  380.    
  381.       // Read the virtual keyboard map
  382.    GetKeys( keyboardState );
  383.    
  384.       // Build our result. We walk our array of mask/keycode
  385.       // pairs until we find a mask equal to zero.
  386.    result = 0;
  387.    for ( index = 0; ModifierCodes[index] != 0; index += 2 )
  388.    {
  389.       unsigned short currentMask, currentCode;
  390.       unsigned short whichLong, whichBit;
  391.       
  392.          // Fetch our current entry
  393.       currentMask = ModifierCodes[index];
  394.       currentCode = ModifierCodes[index+1];
  395.  
  396.          // Translate virtual keycode to map offset.
  397.       whichLong   = (currentCode-1) / BITS_IN_LONG;
  398.       whichBit = (currentCode-1) % BITS_IN_LONG;
  399.       
  400.       if ( keyboardState[whichLong] & (1 << whichBit) )
  401.          result |= currentMask;
  402.    }
  403.  
  404.       // Check the mouse button. This actually looks
  405.       // in the event queue for a mouse-down event;
  406.       // it doesn't check the current mouse status.
  407.    if ( Button( ) )
  408.       result |= btnState;
  409.       
  410.    return result;
  411. }
  412.  
  413.  
  414. > The reason is that my application might want to provide two execution
  415. > mode, one is normal one with menus and windows, but in other mode I want
  416. > the same app to do certain operations automatically.
  417.  
  418. Typically, the second mode would be the "option". Also be sure to check
  419. that you are in the foreground before looking for the option key--you
  420. should ignore it if your application has somehow been launched as a
  421. background process via Apple Events. I use the following code:
  422.  
  423.    if ( IsCurrentProcessForeground( ) )
  424.       gModifiersHeldDownAtLaunch = GetModifiers( );
  425.    else
  426.       gModifiersHeldDownAtLaunch = 0; // no modifiers
  427.  
  428. The function IsCurrentProcessForeground is defined as:
  429.  
  430. //==========================================================================
  431. // IsCurrentProcessForeground
  432. //==========================================================================
  433. // Returns true if the current process is also the foreground process, from
  434. // the user's perspective. If an error occurs, assume it isn't.
  435.  
  436. Boolean IsCurrentProcessForeground( )
  437. {
  438.    ProcessSerialNumber current;
  439.    ProcessSerialNumber front;
  440.    Boolean result;
  441.    OSErr err = noErr;
  442.    
  443.    RETURN_ON_ERR( GetCurrentProcess( ¤t ) );
  444.    RETURN_ON_ERR( GetFrontProcess( &front ) );
  445.    RETURN_ON_ERR( SameProcess( ¤t, &front, &result ) );
  446.  
  447. clean_up:
  448.    return (err == noErr) ? result : false;
  449. }
  450.  
  451. Good luck and have fun!
  452.  
  453. Cheers,
  454. Eric
  455.  
  456. ........................................................................
  457. Eric Kidd (eric.kidd@dartmouth.edu)      http://coos.dartmouth.edu/~emk/
  458. "Computers are useless.  They can only give you answers." -Pablo Picasso
  459.  
  460. ---------------------------
  461.  
  462. >From kerr@math.ohio-state.edu (Kerr Gibson)
  463. Subject: Drag & Drop - Why is finder different?
  464. Date: 29 Dec 1995 12:01:19 -0500
  465. Organization: Department of Mathematics, The Ohio State University
  466.  
  467.  
  468. Hi all,
  469.  
  470. Recently I was discussing with a co-worker how to extend some of our drag and
  471. drop capabilities for our product.  In doing so we noticed that the finder
  472. behaves differently than other products when dragging from it.
  473.  
  474. The finder remains in the background when dragging out of it to other
  475. applications, however, any other program we look at activates first before
  476. allowing the drag.  This is an extremely irritating anomoly.  The user expects
  477. to select something in program A- go to  program B and then drag the selection
  478. from program A to a window in Program B. But as soon as the user mouse downs in
  479. program A- program A activates and (in many if not most instances) covers up
  480. the destination area of program B.  Not only this, but program A will not have
  481. drawn any of its content either so it is doubly irritating.
  482.  
  483. How is it then that the finder is able to remain in the background during a
  484. mouse down?  We have looked all over the documentation for any indication of
  485. how to impliment this in our app but cannot find the subject addressed.  The
  486. nearest thing we found was in the drag&drop human interface guidelines and it
  487. said the following:
  488.  
  489. 'Historically, an inactive window becomes active upon a mouse-down event in
  490. that window. Since the user may drag an item from an inactive window to the
  491. frontmost window, and continue working in the frontmost window, this behavior
  492. must be slightly modified so that, in a certain case described below, the
  493. mouse-up event serves as the window-activation trigger, rather than the
  494. mouse-down event.'
  495.  
  496. But this only seems to be talking about windows in the same app- not different
  497. windows in different apps.  I can only assume that the finder code is cheating
  498. somehow.
  499.  
  500. Anyway, are we missing something obvious here or is this something that cannot
  501. be done?  I should mention also that sticky notes has this same problem, but
  502. the scrapbook does not.
  503.  
  504. -- 
  505. Kerr Gibson 
  506. - ------- 
  507. Someday I'm gonna make a signature file...
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514. -- 
  515. Kerr Gibson              |
  516. kerr@math.ohio-state.edu | Someday I'm gonna make a .signature file...
  517.  
  518. +++++++++++++++++++++++++++
  519.  
  520. >From kenp@nmrfam.wisc.edu (Ken Prehoda)
  521. Date: Fri, 29 Dec 1995 14:32:07 -0600
  522. Organization: Univ of Wisconsin-Madison, Dept of Biochemistry
  523.  
  524. In article <4c16sv$p2q@math.mps.ohio-state.edu>, kerr@math.ohio-state.edu
  525. (Kerr Gibson) wrote:
  526.  
  527. : Hi all,
  528. : Recently I was discussing with a co-worker how to extend some of our drag and
  529. : drop capabilities for our product.  In doing so we noticed that the finder
  530. : behaves differently than other products when dragging from it.
  531. : The finder remains in the background when dragging out of it to other
  532. : applications, however, any other program we look at activates first before
  533. : allowing the drag.  This is an extremely irritating anomoly.  The user expects
  534. : to select something in program A- go to  program B and then drag the selection
  535. : from program A to a window in Program B. But as soon as the user mouse
  536. downs in
  537. : program A- program A activates and (in many if not most instances) covers up
  538. : the destination area of program B.  Not only this, but program A will not have
  539. : drawn any of its content either so it is doubly irritating.
  540. : How is it then that the finder is able to remain in the background during a
  541. : mouse down?  We have looked all over the documentation for any indication of
  542. : how to impliment this in our app but cannot find the subject addressed.  The
  543. : nearest thing we found was in the drag&drop human interface guidelines and it
  544. : said the following:
  545.  
  546.  
  547. The finder registers a callback with the drag manager.  This stuff is
  548. undocumented because the drag manager engineers felt that it was a really
  549. skanky addition to the macintosh hackitecture.
  550.  
  551. Atleast that's the story I got when I asked about the undocumented callback.
  552. _____________________________________________________________________________
  553. Ken Prehoda                                              kenp@nmrfam.wisc.edu
  554. Department of Biochemistry                         http://www.nmrfam.wisc.edu
  555. University of Wisconsin-Madison                             Tel: 608-263-9498
  556. 420 Henry Mall                                              Fax: 608-262-3453
  557.  
  558. +++++++++++++++++++++++++++
  559.  
  560. >From erichsen@pacificnet.net (Erichsen)
  561. Date: 30 Dec 1995 02:13:20 GMT
  562. Organization: Disorganized
  563.  
  564. In article <4c16sv$p2q@math.mps.ohio-state.edu>, kerr@math.ohio-state.edu
  565. (Kerr Gibson) wrote:
  566.  
  567. >The finder remains in the background when dragging out of it to other
  568. >applications, however, any other program we look at activates first before
  569. >allowing the drag.  This is an extremely irritating anomoly.  The user expects
  570. >to select something in program A- go to  program B and then drag the selection
  571. >from program A to a window in Program B. But as soon as the user mouse downs in
  572. >program A- program A activates and (in many if not most instances) covers up
  573. >the destination area of program B.  Not only this, but program A will not have
  574. >drawn any of its content either so it is doubly irritating.
  575.  
  576. The Finder uses an undocumented callback that lets you decide whether to
  577. activate your app or not. Check out the source for WASTE, in the demo he
  578. shows how to do it.
  579.  
  580. +++++++++++++++++++++++++++
  581.  
  582. >From Kerr Gibson <kerr@math.ohio-state.edu>
  583. Date: Thu, 04 Jan 1996 11:21:30 -0500
  584. Organization: The Ohio State University, Department of Mathematics
  585.  
  586. Erichsen wrote:
  587. > The Finder uses an undocumented callback that lets you decide whether to
  588. > activate your app or not. Check out the source for WASTE, in the demo he
  589. > shows how to do it.
  590.  
  591. Well I got WASTE 1.2a4 and compiled the demo in the Symantec Project 
  592. Manager.  The demo had the same problem as everyone else. I made a 
  593. window and selected text and then activated the finder.  Then I 
  594. attempted to drag the text out of the deactivated demo.  All that 
  595. happened was that the demo activated and the text did not even drag 
  596. at all.  I looked through the code for this callback but could not 
  597. seem to locate it.  Perhaps there is some kind of switch in the demo 
  598. I have to turn on?  I'm not doubting your word, maybe I am just 
  599. missing something.
  600.  
  601. -- 
  602. Kerr Gibson
  603. - -------
  604. Someday I'm gonna make a signature file...
  605.  
  606. +++++++++++++++++++++++++++
  607.  
  608. >From erichsen@pacificnet.net (Erichsen)
  609. Date: Fri, 05 Jan 1996 14:36:27 -0700
  610. Organization: Disorganized
  611.  
  612. In article <30EBFE8A.D0D@math.ohio-state.edu>, Kerr Gibson
  613. <kerr@math.ohio-state.edu> wrote:
  614.  
  615. >Well I got WASTE 1.2a4 and compiled the demo in the Symantec Project 
  616. >Manager.  The demo had the same problem as everyone else. I made a 
  617. >window and selected text and then activated the finder.  Then I 
  618. >attempted to drag the text out of the deactivated demo.  All that 
  619. >happened was that the demo activated and the text did not even drag 
  620. >at all.  I looked through the code for this callback but could not 
  621. >seem to locate it.  Perhaps there is some kind of switch in the demo 
  622. >I have to turn on?  I'm not doubting your word, maybe I am just 
  623. >missing something.
  624.  
  625. Sorry, it looks like they've removed it from 1.2a4. Here's the file from
  626. an older demo of WASTE that shows how to do it. I've attached it here.
  627. It's in Pascal but, easy to convert to C or something else.
  628.  
  629.  
  630. +++++++++++++++++++++++++++
  631.  
  632. >From Kerr Gibson <kerr@math.ohio-state.edu>
  633. Date: Thu, 04 Jan 1996 18:24:37 -0500
  634. Organization: The Ohio State University, Department of Mathematics
  635.  
  636. Erichsen wrote:
  637. > Sorry, it looks like they've removed it from 1.2a4. Here's the file from
  638. > an older demo of WASTE that shows how to do it. I've attached it here.
  639. > It's in Pascal but, easy to convert to C or something else.
  640.  
  641. Thanks a lot- I will look into it.
  642.  
  643. -- 
  644. Kerr Gibson
  645. - -------
  646. WARNING: People are attempting to extract personal information from 
  647. you via the internet in order to exploit you.  They cleverly conceal 
  648. their attempts with contests or surveys or 'free' trinkets.  Don't 
  649. be fooled.  Don't give out personal information unless absolutely 
  650. nessesary and then give as little as possible. Don't trade your 
  651. personhood for trinkets.
  652.  
  653. +++++++++++++++++++++++++++
  654.  
  655. >From Kerr Gibson <kerr@math.ohio-state.edu>
  656. Date: Tue, 09 Jan 1996 15:40:39 -0500
  657. Organization: The Ohio State University, Department of Mathematics
  658.  
  659. Kerr Gibson wrote:
  660. > Erichsen wrote:
  661. > >
  662. > > Sorry, it looks like they've removed it from 1.2a4. Here's the file from
  663. > > an older demo of WASTE that shows how to do it. I've attached it here.
  664. > > It's in Pascal but, easy to convert to C or something else.
  665. > >
  666. > Thanks a lot- I will look into it.
  667.  
  668.  
  669. OK, that worked out great.
  670.  
  671. If anyone is interested, we hacked together this system callback in 
  672. Symantec C++.  We even got it to work for the Power PC.  So if 
  673. somebody wants this in WASTE or any other code, we are willing to 
  674. give it out.  Otherwise I guess we will just keep it to ourselves.
  675.  
  676. -- 
  677. Kerr Gibson
  678. - -------
  679. WARNING: People are attempting to extract personal information from 
  680. you via the internet in order to exploit you.  They cleverly conceal 
  681. their attempts with contests or surveys or 'free' trinkets.  Don't 
  682. be fooled.  Don't give out personal information unless absolutely 
  683. nessesary and then give as little as possible. Don't trade your 
  684. personhood for trinkets.
  685.  
  686. ---------------------------
  687.  
  688. >From vanderz@ERC.MsState.Edu (John VanderZwaag)
  689. Subject: File I-O
  690. Date: 10 Jan 1996 01:47:45 GMT
  691. Organization: Mississippi State University
  692.  
  693. I'm coming from a Unix environment - how do Mac programmers do file i/o?  Do you
  694. actually use FSWrite/FSRead?  This seems more difficult than FILE stream.  Are there
  695. comparable Mac functions?  I want to use actual Mac calls and not resort to 
  696. cheating as it seems to have been deemed sinful to do in the Real World.
  697.  
  698. Any help would be more than greatly appreciated.
  699.  
  700. --
  701. john vander zwaag 
  702. jrv1@ra.msstate.edu
  703. vanderz@erc.msstate.edu
  704. http://www.sarc.msstate.edu/Homepages/john
  705.  
  706. +++++++++++++++++++++++++++
  707.  
  708. >From jumplong@aol.com (Jump Long)
  709. Date: 10 Jan 1996 02:15:17 -0500
  710. Organization: America Online, Inc. (1-800-827-6364)
  711.  
  712. John VanderZwaag wrote:
  713. >I'm coming from a Unix environment - how do Mac programmers do
  714. >file i/o?  Do you actually use FSWrite/FSRead?  This seems more
  715. >difficult than FILE stream.  Are there comparable Mac functions?
  716. > I want to use actual Mac calls and not resort to  cheating as
  717. >it seems to have been deemed sinful to do in the Real World.
  718. >
  719. >Any help would be more than greatly appreciated.
  720.  
  721. I actually use FSRead and FSWrite (when I'm not using PBRead and PBWrite),
  722. but then, I'm probably more comfortable with the File Manager than most
  723. after supporting it for several years.
  724.  
  725. Many other programmers use a standard I/O library, or a streams library
  726. (like TCL or PowerPlant provide) built on top of the File Manager and are
  727. happy with that.
  728.  
  729. The biggest advantage you get using the File Manager directly is closer
  730. control at a lower level. For example, with PBRead, you can set a bit that
  731. tells the file system to not cache I/O if possible - something you
  732. probably have no control over when you use a library.  The advantages of
  733. using standard I/O libraries that come with your development environment
  734. are: 1) you're probably familiar with it and 2) it probably provides you
  735. with buffered I/O.
  736.  
  737. If you decide to use the File Manager routines, you might also want to
  738. look at the sample code/library MoreFiles. It shows how to do lots of
  739. common File Manager related things that are Macintosh specific. For
  740. example, getting a list of file in a specific directory. You can get the
  741. latest version of MoreFiles at:
  742.  
  743.   ftp://members.aol.com/JumpLong/MoreFiles_1.4.1.sea.hqx
  744.  
  745. Have fun,
  746. Jim Luther
  747.  
  748. +++++++++++++++++++++++++++
  749.  
  750. >From sample@esltd.com (Don Sample)
  751. Date: Wed, 10 Jan 1996 17:15:09 -0500
  752. Organization: Enerprise Solutions Ltd
  753.  
  754. In article <4cv5s1$nqd@NNTP.MsState.Edu>, vanderz@ERC.MsState.Edu (John
  755. VanderZwaag) wrote:
  756.  
  757. >I'm coming from a Unix environment - how do Mac programmers do file i/o? 
  758. Do you
  759. >actually use FSWrite/FSRead?  This seems more difficult than FILE
  760. stream.  Are there
  761. >comparable Mac functions?  I want to use actual Mac calls and not resort to 
  762. >cheating as it seems to have been deemed sinful to do in the Real World.
  763. >
  764. >Any help would be more than greatly appreciated.
  765. >
  766. >--
  767.  
  768. If you really want to use them, every Mac C programming environment which
  769. I am aware of provides an ANSI standard library with the various FILE
  770. stream function calls.
  771.  
  772. But using the Mac FSpXxxx and FSXxxxx function calls aren't really any
  773. more difficult than the ANSI fxxxxx calls, Especially if you start trying
  774. to open files in multiple directories.
  775.  
  776. -- 
  777. Don Sample (sample@esltd.com)           |  Quando Omni Flunkus
  778. Enterprise Solutions Ltd.               |        Moritati
  779. http://www.esltd.com/esl_people/sample/ |
  780.  
  781. +++++++++++++++++++++++++++
  782.  
  783. >From garyg@jax.jaxnet.com (Gary M. Greenberg)
  784. Date: Thu, 11 Jan 1996 19:49:32 -0500
  785. Organization: Southeast Network Services, Inc.
  786.  
  787. In article <4cv5s1$nqd@NNTP.MsState.Edu>, vanderz@ERC.MsState.Edu (John
  788. VanderZwaag) wrote:
  789.  
  790. > I'm coming from a Unix environment - how do Mac programmers do file
  791. i/o?  Do you
  792. > actually use FSWrite/FSRead?  This seems more difficult than FILE
  793. stream.  Are there
  794. > comparable Mac functions?  I want to use actual Mac calls and not resort to 
  795. > cheating as it seems to have been deemed sinful to do in the Real World.
  796. You've been told, but I use FILE and fopen(), fclose(), et al.
  797.  
  798. I've mostly had to be ANSI C compatible and the Mac handles it just fine.
  799. Portablility has been my issue ...
  800.  
  801. Lo, I await the day when I become a Toolbox power-user ;-)
  802.  
  803. ciao4now,
  804.  
  805. gary /* the Sorcerer's Apprentice */
  806.  
  807. "Why do we have to hide from the police, Daddy?" | Truth:
  808. "Because we use vi, honey. They use emacs."      | This .sig is pirated
  809.  
  810.  
  811. ---------------------------
  812.  
  813. >From McMath_C@mediasoft.net (Chuck E's In Love... McMath)
  814. Subject: First OS for Quicktime?
  815. Date: Thu, 11 Jan 1996 17:16:50 -0500
  816. Organization: Reed Technology & Information Services, Inc.
  817.  
  818. I've got an easy question: at what OS revision did QuickTime first appear,
  819. and what is the first OS where it gets installed as part of the OS
  820. itself?  I thought it was part of 7.0, but other people don't agree, and I
  821. can't find any written confirmation of when it was packed into the system.
  822.  
  823. Thanks in advance,
  824.  
  825. chuck
  826.  
  827. |-- Chuck McMath -- McMath_C@mediasoft.net -or-- chuck@ocs.com -----|
  828. |-- Reed Technology & Information Services, Inc. -------------------|
  829. |-- 20251 Century Blvd. -- Germantown, MD  20874 -------------------|
  830. |-------------- "Hey Batter, Hey Batter, swing!" - Anon.------------|
  831. |--------------- My Karma Ran Over My Dogma ------------------------|
  832.  
  833.  
  834. +++++++++++++++++++++++++++
  835.  
  836. >From jayfar@netaxs.com (Jay Farrell)
  837. Date: Fri, 12 Jan 1996 20:51:58 -0500
  838. Organization: Jayfar's Web
  839.  
  840. In article <McMath_C-1101961716500001@ras112.mediasoft.net>,
  841. McMath_C@mediasoft.net (Chuck E's In Love... McMath) wrote:
  842.  
  843. | I've got an easy question: at what OS revision did QuickTime first appear,
  844. | and what is the first OS where it gets installed as part of the OS
  845. | itself?  I thought it was part of 7.0, but other people don't agree, and I
  846. | can't find any written confirmation of when it was packed into the system.
  847.  
  848. It isn't part of the System yet, if you mean in the sense of it being in
  849. the System file.  It is an extension, or several extensions if you need
  850. Quicktime Musical Instruments or QuickTime PowerPlug (PPC).
  851.  
  852. Just as well, I save some ram by not loading it when I don't intend to use it.
  853.  
  854. Cheers,
  855. Jayfar
  856.  
  857.    ////~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~////
  858.   ////   The Mops Page    <URL:http://www.netaxs.com/~jayfar/mops.html>    ////
  859.  ////~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~////
  860. ////   Mops is Mike Hore's freeware Forth/Smalltalk hybrid for Macintosh ////
  861. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  862.   Jay Farrell     jayfar@netaxs.com        Philadelphia, Pennsylvania, USA
  863.  
  864. +++++++++++++++++++++++++++
  865.  
  866. >From ckt@best.com (Chris Thomas)
  867. Date: Fri, 12 Jan 1996 19:12:49 -0800
  868. Organization: Echo Software
  869.  
  870. In article <McMath_C-1101961716500001@ras112.mediasoft.net>,
  871. McMath_C@mediasoft.net (Chuck E's In Love... McMath) wrote:
  872.  
  873. > I've got an easy question: at what OS revision did QuickTime first appear,
  874. > and what is the first OS where it gets installed as part of the OS
  875. > itself?  I thought it was part of 7.0, but other people don't agree, and I
  876. > can't find any written confirmation of when it was packed into the system.
  877.  
  878. It works (or used to work) with 6.0.7.  I think it was released between
  879. 7.0 and 7.1. It's still not packed into the System.  It is installed by
  880. the 7.5 installer, and I think it was first installed by installers for
  881. some of the 7.1 variants (7.1.1, 7.1.2).
  882.  
  883. -- 
  884. Chris Thomas, ckt@best.com
  885.  
  886.  
  887. ---------------------------
  888.  
  889. >From vcan@bbn.com (V)
  890. Subject: How to render DECENT 256 color sprites
  891. Date: Wed, 03 Jan 1996 11:52:31 -0500
  892. Organization: BBN
  893.  
  894.  
  895. Can I ask what software y'all are using to render your sprites?
  896. I have seen numerous games out there with REALLY nice sprites
  897. when only using 256 colors.
  898.  
  899. I'm writing yet another Ultima type clone and I need graphics!!
  900. I've been trying to draw shapes and such in thousands and try
  901. to convert them down to 256 with horrible results.
  902.  
  903. I have access to photoshop and infini-D (both at work).
  904.  
  905. Should I buy a texture-making plug-in?
  906.  
  907. I can't afford to pay someone to do my graphics..
  908. How can I find someone on the net who can create some for me
  909. in exchange for partial income from the game when it ships?
  910. (shareware really).
  911.  
  912. Also, is there a cheap 3-d rendering package that will give me
  913. decent results with 256 colors?
  914.  
  915.    -V-
  916.  
  917. -- 
  918. Opinions expressed are probably my own.
  919.  
  920. +++++++++++++++++++++++++++
  921.  
  922. >From jregier@qualcomm.com (Jason Regier)
  923. Date: Wed, 03 Jan 1996 10:29:10 -0800
  924. Organization: Qualcomm, Inc.
  925.  
  926. In article <vcan-0301961152310001@vcan.bbn.com>, vcan@bbn.com (V) wrote:
  927. > I'm writing yet another Ultima type clone and I need graphics!!
  928. > I've been trying to draw shapes and such in thousands and try
  929. > to convert them down to 256 with horrible results.
  930. For AmoebArena, almost all of the artwork was rendered on a PC in 24-bit
  931. color  and the result was converted to 256 colors to conserve memory. 
  932. Even though it's in the 8-bit system palette, we've gotten lots of
  933. compliments about the artwork.
  934.  
  935. How did we do it?  Well, for starters, see if your 3D program will render
  936. to a specified palette or bit depth.  I think Infini-D does allow this. 
  937. Rendering your graphics directly to 256 colors will probably look better
  938. than rendering in 24-bit and dithering down to 8-bit.
  939.  
  940. Although I didn't completely like the way Photoshop dithered graphics down
  941. to 8-bit color (I found lots of white pixels scattered all over in some
  942. cases) we took the images in RGB format, and converted them to Indexed
  943. Color.  For our case, we used System Palette - Diffusion.  There's a lot
  944. of different colors in AmoebArena, and for simplicity (and so things
  945. looked good) we chose to work within the system palette rather than use a
  946. custom palette.  If you'd rather use a custom palette, I'm almost certain
  947. Photoshop will generate one for you.  If I'm not mistaken, go to Indexed
  948. color, select Exact, and Photoshop will choose exactly which colors you
  949. picture needs and stores them in a clut when saving your PICT.  You can
  950. copy the clut and the PICT resource over to your game's resource file, and
  951. access them both to bring your beauty to the screen.
  952.  
  953. Well, I hope you haven't tried the above with no success.  If things STILL
  954. don't look good, there most likely isn't much you can do except take your
  955. 8-bit sprites and go over them by hand and touch them up so they look
  956. right.
  957.  
  958. Good luck!
  959. Jason
  960.  
  961. -- 
  962. Jason Regier
  963. GlobalStar Software Engineer
  964. QUALCOMM, Inc.
  965. (619) 658-4752
  966. jregier@qualcomm.com
  967.  
  968. +++++++++++++++++++++++++++
  969.  
  970. >From rmckay@chat.carleton.ca (Reevan McKay)
  971. Date: Mon, 8 Jan 1996 06:13:59 GMT
  972. Organization: Carleton University
  973.  
  974. Jason Regier (jregier@qualcomm.com) wrote:
  975.  
  976. > Rendering your graphics directly to 256 colors will probably look better
  977. > than rendering in 24-bit and dithering down to 8-bit.
  978.  
  979.         True, although another thing to consider is to avoid dithering
  980. your sprites when you map them to 8 bits.  Dithering tends to look very
  981. silly unless it is done carefully.  If you are using photoshop, try using
  982. the "None" option under "Dithering": the color match won't be quite as
  983. exact, but your customers will never know the difference... and they won't
  984. see (shudder) horrible dithering.
  985.  
  986.         A note on PShop palettes...  They are NOT stored as CLUTs (at
  987. least not in v 2.51).  They are pure data files, 768 bytes long, I
  988. believe.  There are always 256 entries, though spare (unused) entries
  989. contain the color black.  Each entry is three bytes, each representing a
  990. value from 0-255 for Red, Green and Blue respectively.  I think I've got a
  991. code chunk sitting around which reads a PShop palette and converts it to a
  992. color table for your application's use.  If you can't get it work on your
  993. own, let me know and I'll see what I can dig up (HINT: Get _Inside_Macintosh:_
  994. Files_ if you haven't already).
  995.  
  996. > (take your)
  997. > 8-bit sprites and go over them by hand and touch them up so they look
  998. > right.
  999.  
  1000.         This is almost an inevitability anyways.
  1001.  
  1002. > Good luck!
  1003. > Jason
  1004. Ditto
  1005.  
  1006. - --------------------------------------------------------------------
  1007. Mikado
  1008. Second Year Architecture
  1009. Carleton University
  1010.  
  1011. "Jesus was an architect, previous to his career as a prophet."
  1012.  
  1013. Email address: rmckay@chat.carleton.ca
  1014. - --------------------------------------------------------------------
  1015.  
  1016. ---------------------------
  1017.  
  1018. >From Richard Gaitskell <gaitskell@physics.berkeley.edu>
  1019. Subject: Launching Application on Remote Mac CPU
  1020. Date: 3 Jan 1996 01:51:02 GMT
  1021. Organization: Center for Particle Astrophysics, Berkeley
  1022.  
  1023. Is there a way to launch a new application on a remote Macintosh's CPU
  1024. assuming you can connect to the Mac via an AppleTalk/Ethernet network 
  1025. and have the appropriate access privileges ?
  1026.  
  1027. I believe the commercial package "Timbuktu" permits you to take over a 
  1028. remote machine. However, is there a way to simply launch an application 
  1029. by sending an instruction to the remote mac's Finder using AppleScript ?
  1030.  
  1031.  
  1032. Rick Gaitskell
  1033. Center for Particle Astrophysics
  1034. UC Berkeley, CA
  1035.  
  1036. gaitskell@physics.berkeley.edu
  1037.  
  1038.  
  1039.  
  1040. +++++++++++++++++++++++++++
  1041.  
  1042. >From zobkiw@triplesoft.com (Joe Zobkiw)
  1043. Date: Wed, 03 Jan 1996 19:55:08 -0500
  1044. Organization: TripleSoft Inc.
  1045.  
  1046. In article <4ccne6$mtr@agate.berkeley.edu>, Richard Gaitskell
  1047. <gaitskell@physics.berkeley.edu> wrote:
  1048.  
  1049. >Is there a way to launch a new application on a remote Macintosh's CPU
  1050. >assuming you can connect to the Mac via an AppleTalk/Ethernet network 
  1051. >and have the appropriate access privileges ?
  1052. >
  1053. >I believe the commercial package "Timbuktu" permits you to take over a 
  1054. >remote machine. However, is there a way to simply launch an application 
  1055. >by sending an instruction to the remote mac's Finder using AppleScript ?
  1056.  
  1057. Make sure Program Linking is enabled on the receiving machine and send an
  1058. AppleEvent to the Finder on that machine. Assuming you know the location
  1059. of the file, you can launch it quite easily. Another way is to write a
  1060. small "server" application that uses the PPC Toolbox. This runs on the
  1061. remote machine and gives you access to the specific files you need.
  1062. Depending on your needs, the PPC Toolbox/AppleEvents is probably a good
  1063. way to go.
  1064.  
  1065. Joe Zobkiw                         <mailto:zobkiw@triplesoft.com>
  1066. TripleSoft Inc.                      <http://www.triplesoft.com/>
  1067. Specializing in Custom Macintosh Software Development & Solutions
  1068. - ---------------------------------------------------------------
  1069. Macintosh programmers! Check out "A Fragment of Your Imagination"
  1070.    from Addison-Wesley <http://www.triplesoft.com/fragment/>
  1071.  
  1072. +++++++++++++++++++++++++++
  1073.  
  1074. >From jumplong@aol.com (Jump Long)
  1075. Date: 12 Jan 1996 05:37:48 -0500
  1076. Organization: America Online, Inc. (1-800-827-6364)
  1077.  
  1078. Richard Gaitskell wrote:
  1079. >Is there a way to launch a new application on a remote
  1080. >Macintosh's CPU assuming you can connect to the Mac via an
  1081. >AppleTalk/Ethernet network  and have the appropriate access
  1082. >privileges ?
  1083. >
  1084. >I believe the commercial package "Timbuktu" permits you to take
  1085. >over a  remote machine. However, is there a way to simply launch
  1086. >an application  by sending an instruction to the remote mac's
  1087. >Finder using AppleScript ?
  1088.  
  1089. If you have program linking turned ON on the remote system, you can use
  1090. this AppleScript:
  1091.  
  1092. tell application "Finder" of machine "RemoteMac" of zone "Zone"
  1093.   open file "volume:directory:myApp"
  1094. end tell
  1095.  
  1096. - Jim Luther
  1097.  
  1098. +++++++++++++++++++++++++++
  1099.  
  1100. >From ck@be.com (C.K. Haun)
  1101. Date: Fri, 12 Jan 1996 10:22:36 -0800
  1102. Organization: Be, Inc.
  1103.  
  1104. > >Is there a way to launch a new application on a remote
  1105. > >Macintosh's CPU assuming you can connect to the Mac via an
  1106. > >AppleTalk/Ethernet network  and have the appropriate access
  1107. > >privileges ?
  1108. > If you have program linking turned ON on the remote system, you can use
  1109. > this AppleScript: 
  1110. > tell application "Finder" of machine "RemoteMac" of zone "Zone"
  1111. >   open file "volume:directory:myApp"
  1112. > end tell
  1113.  
  1114. You can also send the same event directly by sending a OpenSelection event
  1115. to the remote Finder (that's what APpelScript is doing in this case).  
  1116. Note a few things;
  1117. 1) You must supply the *full path* to the item. You can't use a relative
  1118. path and can't use a file alias
  1119. 2) If you get it wrong, the remote Mac will display a really weird and
  1120. unusual error dialog to the user on the remote Mac, which could be
  1121. confusing.  Or as Jim will confirm, sometimes amusing.
  1122. 3) There is no confirmation that this actually worked.  You will have to
  1123. wait an appropriate period of time and try and find the newly lanched
  1124. application yourself through the PPC browser or IPCListPorts.
  1125. 4) The sample "FinderOpenSel 2.x" has code to do this in it.
  1126. C.K. Haun
  1127. The Developer Guy @ Be, Inc.
  1128.  
  1129. -- 
  1130. C.K. Haun
  1131. ck@be.com
  1132.                   The Mild Bunch
  1133. 1996 Royal Star 1300    1991 Voyager 1200    1990 Virago 750
  1134. 1993 Virago 535         1987 Reflex 225
  1135.  
  1136.  
  1137. ---------------------------
  1138.  
  1139. >From jmunkki@beta.hut.fi (Juri Munkki)
  1140. Subject: MakeRGBPat Sucks (and how you can do better)
  1141. Date: 31 Dec 1995 10:03:03 GMT
  1142. Organization: Helsinki University of Technology
  1143.  
  1144. A game I'm writing really shines in thousands and millions of colors because
  1145. it has access to all the colors it needs. In 256 colors, some colors didn't
  1146. look all that good.
  1147.  
  1148. The Apple System palette has a map of 6x6x6 colors (216 colors) plus some
  1149. gray shades and shades of pure red/green/blue that are not in the 6x6x6
  1150. map.
  1151.  
  1152. My first idea was to use a custom palette for some of the more critical
  1153. colors. The problem is that I wasn't sure which colors I should give up
  1154. from the default 256 for these colors. All in all, it seemed like a messy
  1155. solution.
  1156.  
  1157. In 4 and 16 colors I have always used MakeRGBPat and used the resulting
  1158. patterns instead of solid colors.
  1159.  
  1160. So, I examined my drawing code and found that doing a patterned fill in
  1161. 8 bit mode wasn't any more expensive than the solid fill.
  1162.  
  1163. The next step was to use MakeRGBPat to make 2x2 patterns from the 256
  1164. color palette.
  1165.  
  1166. That's where I ran into problems. The patterns draw just fine and in
  1167. some cases they looked ok. In many cases, the patterns would look really
  1168. bad. MakeRGBPat uses up to four colors, but usually it only uses two and
  1169. it tries to balance them so that they average to the requested color. In
  1170. many cases it just does a very bad job and gives me an almost white when
  1171. I requested something quite different. Using only the top two colors
  1172. helped a bit for some reason, so I started suspecting that MakeRGBPat
  1173. wasn't doing it right.
  1174. So, the next approach was to roll my own RGBPat. I decided to keep it
  1175. simple and only use two colors in a patter like this:
  1176.  
  1177.         A B
  1178.         B A
  1179.  
  1180. A pattern like this is very hard to detect on most monitors. I have to
  1181. look really closely on my 16" Apple RGB monitor to see the patterns if
  1182. A and B are close in color.
  1183.  
  1184. The first step is to use Color2Index to request color A. This is the main
  1185. color of the pattern and should be closest thing that can be found to the
  1186. color we want.
  1187.  
  1188. Then, we find out what this index really maps to by calling Index2Color.
  1189. This enables us to calculate the different between A and the color we
  1190. really needed (call it N). I use a simple distance estimator function
  1191. to get the distance in RGB space.
  1192.  
  1193. If the distance is 0, we have an exact match and the pattern can be
  1194. a solid where B = A.
  1195.  
  1196. Next, we have to figure out what a good B would be. The ideal case would
  1197. be that the average of A and B would be N. So if (A+B)/2 = N, then we
  1198. get that B = 2N - A. We use Color2Index to find the closest color to B.
  1199. We convert this index back to RGB and calculate (A+B)/2. This is the
  1200. color we get when we mix A and B on the screen. If the distance between
  1201. N and (A+B)/2 is smaller than the distance between N and A, we use the
  1202. color B in the pattern, otherwise we use a solid A pattern.
  1203.  
  1204. Now I wasn't sure how this would work. I felt a bit stupid writing
  1205. something as simple as this, when Apple in its wisdom provided a
  1206. function that _should_ do better.
  1207.  
  1208. To my surprise, my algorithm produces extremely pleasing results. If I
  1209. look at the screen from a typical viewing distance, it's hard to tell
  1210. the difference between 256 and millions of colors (in my application).
  1211.  
  1212. There are none of the awful artifacts that I got with MakeRGBPat. I
  1213. find it hard to believe that MakeRGBPat would even be any faster,
  1214. because the only expensive calls that I make are the two calls to
  1215. Color2Index.
  1216.  
  1217. -- 
  1218. Juri Munkki jmunkki@iki.fi              Life is easy when polygons are cheap.
  1219. http://www.iki.fi/~jmunkki                 Windsurfing: Faster than the wind.
  1220.  
  1221. +++++++++++++++++++++++++++
  1222.  
  1223. >From Matt Slot <fprefect@umich.edu>
  1224. Date: 31 Dec 1995 18:42:24 GMT
  1225. Organization: University of Michigan
  1226.  
  1227. Juri Munkki, jmunkki@beta.hut.fi writes:
  1228.  > So, the next approach was to roll my own RGBPat.
  1229.  
  1230. Your description of the technique is excellent, but is there
  1231. any chance you could post the corresponding code you've written 
  1232. for your "BetterRGBPat()" function?
  1233.  
  1234. Matt
  1235.  
  1236. * * * * * * * * * * * * * * * * * * * * * * * * * * ======================
  1237. *  Reality: Matt Slot                             *  Time is an illusion.
  1238. *  E-Mail:  mailto:fprefect@umich.edu             *  Lunchtime doubly so.
  1239. *  Web:     http://www.sils.umich.edu/~fprefect/  *     -- Douglas Adams
  1240. * * * * * * * * * * * * * * * * * * * * * * * * * * ======================
  1241.  
  1242. +++++++++++++++++++++++++++
  1243.  
  1244. >From jmunkki@beta.hut.fi (Juri Munkki)
  1245. Date: 1 Jan 1996 05:49:08 GMT
  1246. Organization: Helsinki University of Technology
  1247.  
  1248. In article <4c6lig$b3f@srvr1.engin.umich.edu> Matt Slot <fprefect@umich.edu> writes:
  1249. >Juri Munkki, jmunkki@beta.hut.fi writes:
  1250. > > So, the next approach was to roll my own RGBPat.
  1251. >
  1252. >Your description of the technique is excellent, but is there
  1253. >any chance you could post the corresponding code you've written 
  1254. >for your "BetterRGBPat()" function?
  1255.  
  1256. The problem is that I do all my own rendering (Quickdraw is used to
  1257. manage colors and graphics devices and that's it), so when I removed
  1258. the call to MakeRGBPat, I also changed my code so that it directly
  1259. writes into my own structures (for 8 bit devices a 4 x 2 pixels).
  1260.  
  1261. So, the function only covers 8 bit pixmaps and doesn't create a real
  1262. pixel pattern.
  1263.  
  1264. Since you asked so kindly, here it is. Don't expect it to compile,
  1265. because the distance estimator is not there (you can use the sum
  1266. of squares, if you want really accurate results, but watch the
  1267. number ranges for overflows).
  1268.  
  1269. It's also just my first draft at the algorithm.
  1270.  
  1271. void    Build8BitColorMap(
  1272.         PolyDevice              **aPolyDevice,
  1273.         PolyColorTable  *aColorTable)
  1274. {
  1275.         GDHandle                savedGD;
  1276.         GrafPtr                 saved;
  1277.         RGBColor                tempColor;
  1278.         long                    colorA;
  1279.         short                   i;
  1280.         char                    *dest;
  1281.         Handle                  destTable;
  1282.  
  1283.         GetPort(&saved);
  1284.         savedGD = GetGDevice();
  1285.  
  1286.         SetGDevice((*aPolyDevice)->itsDevice);
  1287.  
  1288.         destTable = (*aPolyDevice)->colorMap;
  1289.         SetHandleSize(destTable,aColorTable->polyColorCount * 8L);
  1290.         HLock(destTable);
  1291.  
  1292.         dest = *destTable;
  1293.  
  1294.         for(i=0;i<aColorTable->polyColorCount;i++)
  1295.         {       RGBColor        friendColor;
  1296.                 long            colorB;
  1297.                 long            redDelta, greenDelta, blueDelta;
  1298.                 long            oneErr, twoErr;
  1299.         
  1300.                 colorA = (*aColorTable->colorEntryHandle)[i].color;
  1301.  
  1302.                 tempColor.red = ((unsigned char *)&colorA)[1];
  1303.                 tempColor.green = ((unsigned char *)&colorA)[2];
  1304.                 tempColor.blue = ((unsigned char *)&colorA)[3];
  1305.                 
  1306.                 tempColor.red += tempColor.red << 8;
  1307.                 tempColor.green += tempColor.green << 8;
  1308.                 tempColor.blue += tempColor.blue << 8;
  1309.  
  1310.                 colorA = Color2Index(&tempColor);
  1311.                 Index2Color(colorA, &friendColor);
  1312.                 
  1313.                 redDelta = friendColor.red - (long)tempColor.red;
  1314.                 greenDelta = friendColor.green - (long)tempColor.green;
  1315.                 blueDelta = friendColor.blue - (long)tempColor.blue;
  1316.  
  1317.                 oneErr = FDistanceOverEstimate(redDelta, greenDelta, blueDelta);
  1318.                 
  1319.                 if(oneErr)
  1320.                 {       redDelta = tempColor.red - redDelta;
  1321.                         greenDelta = tempColor.green - greenDelta;
  1322.                         blueDelta = tempColor.blue - blueDelta;
  1323.         
  1324. #define BOUNDVALUE(a)   ((a < 0) ? 0 : ((a > 65536) ? 65535 : a))
  1325.         
  1326.                         friendColor.red = BOUNDVALUE(redDelta);
  1327.                         friendColor.green = BOUNDVALUE(greenDelta);
  1328.                         friendColor.blue = BOUNDVALUE(blueDelta);
  1329.         
  1330.                         colorB = Color2Index(&friendColor);
  1331.                         Index2Color(colorB, &friendColor);
  1332.                         
  1333.                         friendColor.red = (friendColor.red + (long)tempColor.red) >> 1;
  1334.                         friendColor.green = (friendColor.green + (long)tempColor.green) >> 1;
  1335.                         friendColor.blue = (friendColor.blue + (long)tempColor.blue) >> 1;
  1336.         
  1337.                         redDelta = tempColor.red - (long)friendColor.red;
  1338.                         greenDelta = tempColor.green - (long)friendColor.green;
  1339.                         blueDelta = tempColor.blue - (long)friendColor.blue;
  1340.         
  1341.                         twoErr = FDistanceOverEstimate(redDelta, greenDelta, blueDelta);
  1342.                         
  1343.                         if(twoErr > oneErr)
  1344.                         {       colorB = colorA;
  1345.                         }
  1346.                 }
  1347.                 else
  1348.                 {       colorB = colorA;
  1349.                 }
  1350.  
  1351.                 //      Form a pattern using the two pixels:
  1352.                 *dest++ = colorA;       *dest++ = colorB;       *dest++ = colorA;       *dest++ = colorB;
  1353.                 *dest++ = colorB;       *dest++ = colorA;       *dest++ = colorB;       *dest++ = colorA;
  1354.  
  1355.         }
  1356.  
  1357.         HUnlock(destTable);
  1358.         SetGDevice(savedGD);
  1359.         SetPort(saved);
  1360. }
  1361.  
  1362.  
  1363. -- 
  1364. Juri Munkki jmunkki@iki.fi              Life is easy when polygons are cheap.
  1365. http://www.iki.fi/~jmunkki                 Windsurfing: Faster than the wind.
  1366.  
  1367. +++++++++++++++++++++++++++
  1368.  
  1369. >From jmunkki@beta.hut.fi (Juri Munkki)
  1370. Date: 3 Jan 1996 03:22:03 GMT
  1371. Organization: Helsinki University of Technology
  1372.  
  1373. I ran an exhaustive test of my two-color version of MakeRGBPat using the
  1374. default system palette and default inverse tables and color matching.
  1375.  
  1376. Apple says that MakeRGBPat will get you 2197 colors using a four color
  1377. 2x2 pattern.
  1378.  
  1379. I'm using a two color 2x2 pattern. I thought I would only get a few
  1380. hundred colors or so using my own method, but guess what? I get 2505
  1381. unique color matches.
  1382.  
  1383. Inside Mac admits that the algorithm is optimized for speed rather than
  1384. quality, but I still say they are doing a bad job in 8 bit color.
  1385.  
  1386. I also went for the simplest approach I could think of. It takes an
  1387. average of 64 microseconds to make one pattern on a Quadra 700, which
  1388. means that the entire 24 bit color space was matched in 18 minutes.
  1389.  
  1390. -- 
  1391. Juri Munkki jmunkki@iki.fi              Life is easy when polygons are cheap.
  1392. http://www.iki.fi/~jmunkki                 Windsurfing: Faster than the wind.
  1393.  
  1394. +++++++++++++++++++++++++++
  1395.  
  1396. >From ckt@best.com (Chris Thomas)
  1397. Date: Fri, 05 Jan 1996 21:13:14 -0800
  1398. Organization: Echo Software
  1399.  
  1400. In article <4ccsor$ofe@nntp.hut.fi>, jmunkki@beta.hut.fi (Juri Munkki) wrote:
  1401.  
  1402. > I ran an exhaustive test of my two-color version of MakeRGBPat using the
  1403. > default system palette and default inverse tables and color matching.
  1404. > Apple says that MakeRGBPat will get you 2197 colors using a four color
  1405. > 2x2 pattern.
  1406. > I'm using a two color 2x2 pattern. I thought I would only get a few
  1407. > hundred colors or so using my own method, but guess what? I get 2505
  1408. > unique color matches.
  1409. > Inside Mac admits that the algorithm is optimized for speed rather than
  1410. > quality, but I still say they are doing a bad job in 8 bit color.
  1411. > I also went for the simplest approach I could think of. It takes an
  1412. > average of 64 microseconds to make one pattern on a Quadra 700, which
  1413. > means that the entire 24 bit color space was matched in 18 minutes.
  1414.  
  1415. Curious, how does MakeRGBPat compare to that time?
  1416.  
  1417. -- 
  1418. Chris Thomas, ckt@best.com
  1419.  
  1420. +++++++++++++++++++++++++++
  1421.  
  1422. >From jmunkki@beta.hut.fi (Juri Munkki)
  1423. Date: 6 Jan 1996 07:17:20 GMT
  1424. Organization: Helsinki University of Technology
  1425.  
  1426. In article <ckt-0501962113140001@ckt.vip.best.com> ckt@best.com (Chris Thomas) writes:
  1427. >Curious, how does MakeRGBPat compare to that time?
  1428.  
  1429. It's difficult to say, because MakeRGBPat works by setting up a color
  1430. pattern without actually doing the color lookups. So the actual time
  1431. spent in MakeRGBPat is probably short.
  1432.  
  1433. Then, when you start drawing, QuickDraw looks up the colors. Since
  1434. there are up to four colors, it probably calls Color2Index at least
  1435. twice and most likely four times (I haven't checked).
  1436.  
  1437. If your drawing spans several displays with different color tables,
  1438. I assume QD has to redo the mapping each time for each different
  1439. device, since it only stores one pattern at a time.
  1440.  
  1441. So, the advantage of MakeRGBpat seems to be that it automatically
  1442. adjusts to changing screen depths and color tables.
  1443.  
  1444. My code is used when the cached patterns cdSeed doesn't match the
  1445. device ctSeed. I keep the patterns for each device separetely, so
  1446. multiple devices do not cause any overhead in this respect.
  1447.  
  1448. Has anyone tried MakeRGBPat with 24 bit and 15 bit color? If it works
  1449. the way I suspect it might, you would still get patterns. (It's easy
  1450. enough to try...I should probably take five minutes some day and check
  1451. what happens.)
  1452.  
  1453. I guess the whole point is that they (Apple) didn't want to add special
  1454. case code to QuickDraw pattern drawing routines to handle RGBPats and
  1455. yet they wanted RGBPats to be independent of the device color map.
  1456.  
  1457. I'm feeling a bit fuzzy today, so I'm not sure if this makes sense
  1458. to anyone. Sorry.
  1459.  
  1460. -- 
  1461. Juri Munkki jmunkki@iki.fi              Life is easy when polygons are cheap.
  1462. http://www.iki.fi/~jmunkki                 Windsurfing: Faster than the wind.
  1463.  
  1464. +++++++++++++++++++++++++++
  1465.  
  1466. >From jinjur@kudonet.com (john calhoun)
  1467. Date: 9 Jan 1996 04:49:01 GMT
  1468. Organization: Scheherazade Software
  1469.  
  1470. In article <4cl7m0$bcr@nntp.hut.fi>, jmunkki@beta.hut.fi (Juri Munkki) wrote:
  1471.  
  1472. > Has anyone tried MakeRGBPat with 24 bit and 15 bit color? If it works
  1473. > the way I suspect it might, you would still get patterns.
  1474.  
  1475. I have, and my experience with it is that you don't in fact get patterns,
  1476. but rather get your RGBColor (if it is a "pattern", it is a SOLID pattern
  1477. anyway).  So it does the right thing on direct devices.
  1478.  
  1479. john calhoun-
  1480.  
  1481. +++++++++++++++++++++++++++
  1482.  
  1483. >From tobyt@netspace.net.au (Toby Thain)
  1484. Date: Wed, 10 Jan 1996 22:15:04 +1000
  1485. Organization: NetSpace Online Systems
  1486.  
  1487. In article <jinjur-0801962046540001@165.227.52.125>, jinjur@kudonet.com
  1488. (john calhoun) wrote:
  1489.  
  1490. > In article <4cl7m0$bcr@nntp.hut.fi>, jmunkki@beta.hut.fi (Juri Munkki) wrote:
  1491. > So it does the right thing on direct devices.
  1492.  
  1493. Well, not really the right thing if the idea is to get the closest
  1494. approximation to the target colour (which could easily be a combination of
  1495. direct colour values, since the target is specified with 16 bits per
  1496. channel).
  1497.  
  1498.  
  1499. ---------------------------
  1500.  
  1501. >From DaveZ@mailbag.com (David B. Zwiefelhofer)
  1502. Subject: MoveControl Doesn't Change Dialog Item Rect
  1503. Date: Wed, 10 Jan 1996 10:02:47 -0500
  1504. Organization: Utility Reduction Specialists, Inc.
  1505.  
  1506. I have a movable modal dialog with controls (check boxes implemented with
  1507. control resources) that I need to move around. Unfortunately, moving them
  1508. via MoveControl only moves the control's contrlRect and not the item's
  1509. rect. Therefore, calls such as DialogSelect don't work.
  1510.  
  1511. Does anyone know how to move a dialog item's rect? Obviously it can be
  1512. done as AppendDITL does this. How can I?
  1513.  
  1514. Thanks,
  1515.  
  1516. Dave
  1517.  
  1518. -- 
  1519. David B. Zwiefelhofer
  1520. Utility Reduction Specialists, Inc.
  1521. 1605 Monroe Street, Suite 110
  1522. Madison, WI  53211-2052
  1523. (608) 258-8965
  1524. (608) 258-9686 FAX
  1525.  
  1526. +++++++++++++++++++++++++++
  1527.  
  1528. >From DaveZ@mailbag.com (David B. Zwiefelhofer)
  1529. Date: Thu, 11 Jan 1996 16:58:49 -0500
  1530. Organization: Utility Reduction Specialists, Inc.
  1531.  
  1532. In article <francois-regis.degott-1101961100520001@harpie.imag.fr>,
  1533. francois-regis.degott@imag.fr (Fr. Degott) wrote:
  1534.  
  1535. > Hi Dave,
  1536. > i remember this question was asked before…
  1537. > From memory, you should use GetDItem() balanced with
  1538. > a SetDItem() call to change the item rect.
  1539. > something like this:
  1540. > GetDItem(dlog,item,&iType,&iHandle,&iRect);
  1541. > SetRect(&newRect,blah,blah,blah,blah);
  1542. > SetDItem(dlog,item,iType,iHandle,newRect);
  1543.  
  1544. Thanks. I guess I had one of those "where are my glasses?!" kind of
  1545. things. There they were, on top of my head the whole time!
  1546.  
  1547. -Dave
  1548.  
  1549. -- 
  1550. David B. Zwiefelhofer
  1551. Utility Reduction Specialists, Inc.
  1552. 1605 Monroe Street, Suite 110
  1553. Madison, WI  53211-2052
  1554. (608) 258-8965
  1555. (608) 258-9686 FAX
  1556.  
  1557. +++++++++++++++++++++++++++
  1558.  
  1559. >From rickgenter@aol.com (RickGenter)
  1560. Date: 12 Jan 1996 05:18:27 -0500
  1561. Organization: America Online, Inc. (1-800-827-6364)
  1562.  
  1563. >>>
  1564. Does anyone know how to move a dialog item's rect? Obviously it can be
  1565. done as AppendDITL does this. How can I?
  1566. <<<
  1567.  
  1568. Call GetDialogItem (GetDItem using the old routine names), which returns
  1569. the dialog item rectangle, type and handle, change the rectangle, then
  1570. call SetDialogItem (SetDItem) to pass the change to the Dialog Manager.
  1571.  
  1572. Rick Genter
  1573. Papyrus Design Group, Inc.
  1574.  
  1575. ---------------------------
  1576.  
  1577. >From jhg@kepler.unh.edu (Jeff Gunn)
  1578. Subject: Newbie help with events....
  1579. Date: 9 Jan 1996 21:52:42 GMT
  1580. Organization: University of New Hampshire
  1581.  
  1582.         Okay - I'm very familiar with programming in C and C++, but I'm 
  1583. just starting out with mac programming.  I'm using CodeWarrior.  I've 
  1584. succeeded in producing a window and displaying it, and having it disappear 
  1585. as soon as the mouse button is pressed.  I want something more useful.  
  1586. I want to implement the close box, so the window stays open until I click 
  1587. the close box.  I think I need to use "WaitNextEvent", but I'm not sure.  
  1588. Anyone with advice or a little code snippet?  Thanks...
  1589.  
  1590.                         -Jeff Gunn (jeff.gunn@unh.edu)
  1591.  
  1592. -- 
  1593. Jeffrey Gunn                    | Senior Consultant
  1594. Jeff.Gunn@unh.edu               | Computing and Information Services
  1595.         ----                    | University of New Hampshire   
  1596. "Saying Windows 95 is equal to Macintosh is like finding a potato
  1597.   that looks like Jesus and believing you've witnessed the second coming."
  1598.                                 -Guy Kawasaki
  1599.  
  1600.  
  1601. +++++++++++++++++++++++++++
  1602.  
  1603. >From kenlong@netcom.com (Ken Long)
  1604. Date: Wed, 10 Jan 1996 03:11:29 GMT
  1605. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  1606.  
  1607. Jeff Gunn (jhg@kepler.unh.edu) wrote:
  1608. :       Okay - I'm very familiar with programming in C and C++, but I'm 
  1609. : just starting out with mac programming.  I'm using CodeWarrior.  I've 
  1610. : succeeded in producing a window and displaying it, and having it disappear 
  1611. : as soon as the mouse button is pressed.  I want something more useful.  
  1612. : I want to implement the close box, so the window stays open until I click 
  1613. : the close box.  I think I need to use "WaitNextEvent", but I'm not sure.  
  1614.  
  1615. There are several "snippets" on your CW CD.  "SillyBalls" exits on 
  1616. mouseDown, but some of the other examples don't.  Find one that doesn't 
  1617. (has close box) and compare the differences to the main loop in that one 
  1618. to the main loop in yours.
  1619.  
  1620. The should be some third party example sources on that CD as well.
  1621.  
  1622. -Ken-
  1623.  
  1624. +++++++++++++++++++++++++++
  1625.  
  1626. >From schmeul@umich.edu (Sam Huffman)
  1627. Date: Thu, 11 Jan 1996 22:14:13 -0500
  1628. Organization: University of Michigan
  1629.  
  1630. In article <4cuo3a$juq@mozz.unh.edu>, jhg@kepler.unh.edu (Jeff Gunn) wrote:
  1631.  
  1632.  >         Okay - I'm very familiar with programming in C and C++, but I'm 
  1633.  > just starting out with mac programming.  I'm using CodeWarrior.  I've 
  1634.  > succeeded in producing a window and displaying it, and having it disappear 
  1635.  > as soon as the mouse button is pressed.  I want something more useful.  
  1636.  > I want to implement the close box, so the window stays open until I click 
  1637.  > the close box.  I think I need to use "WaitNextEvent", but I'm not sure.  
  1638.  > Anyone with advice or a little code snippet?  Thanks...
  1639.  > 
  1640.  >                         -Jeff Gunn (jeff.gunn@unh.edu)
  1641.  
  1642. Well here's a simple example. Sorry it's not terribly complete - just
  1643. grabbed it out of a program I happened to have open. You'll need to write
  1644. the code for most of the functions. Actually you can just comment out most
  1645. of what you're not using. For good examples check sumex-aim
  1646. (ftp://mirrors.aol.com/pub/info-mac/ or something like that) in the
  1647. development/source directory.
  1648.  
  1649. Boolean gDone = false;
  1650.  
  1651. void main(void)
  1652. {
  1653.    InitMacintosh();
  1654.    
  1655.    while (!gDone) EventLoop();
  1656.    QuitProgram();
  1657. }
  1658.  
  1659. void EventLoop(void)
  1660. {
  1661.    EventRecord theEvent;
  1662.    OSErr iErr;
  1663.    
  1664.    if (WaitNextEvent(everyEvent, &theEvent, 0xFFFFFFFF, NULL)) {
  1665.       switch(theEvent.what) {
  1666.          case mouseDown:
  1667.             HandleMouseDown(&theEvent);
  1668.             break;
  1669.          
  1670.          case kHighLevelEvent:
  1671.             iErr = AEProcessAppleEvent(&theEvent);
  1672.             break;
  1673.          
  1674.          case keyDown:
  1675.          case autoKey:
  1676.             if ((theEvent.modifiers & cmdKey) != 0)
  1677.                HandleMenuChoice(MenuKey(theEvent.message & charCodeMask));
  1678.             else HandleKey(theEvent.message & charCodeMask);
  1679.             break;
  1680.          
  1681.          case updateEvt:
  1682.             HandleUpdate((WindowPtr)theEvent.message);
  1683.             break;
  1684.          
  1685.          case activateEvt:
  1686.             HandleActivate(&theEvent);
  1687.             break;
  1688.             
  1689.          default:
  1690.             HandleNull();
  1691.             break;
  1692.       }
  1693.    }
  1694. }
  1695.  
  1696. void HandleMouseDown(EventRecord *theEvent)
  1697. {
  1698.    WindowPtr theWindow;
  1699.    short thePart;
  1700.    long menuChoice;
  1701.    
  1702.    thePart = FindWindow(theEvent->where, &theWindow);
  1703.    switch(thePart) {
  1704.       case inMenuBar:
  1705.          menuChoice = MenuSelect(theEvent->where);
  1706.          HandleMenuChoice(menuChoice);
  1707.          break;
  1708.          
  1709.       case inSysWindow:
  1710.          SystemClick(theEvent, theWindow);
  1711.          break;
  1712.          
  1713.       case inDrag:
  1714.          DragWindow(theWindow, theEvent->where, &qd.screenBits.bounds);
  1715.          break;
  1716.       
  1717.       case inContent:
  1718.          if (theWindow == FrontWindow()) HandleClick(theWindow, theEvent);
  1719.          else SelectWindow(theWindow);
  1720.          break;
  1721.       
  1722.       case inGoAway:
  1723.          if (TrackGoAway(theWindow, theEvent->where) == true) {
  1724.             CloseMyWindow(theWindow);
  1725.          }
  1726.          break;
  1727.    }
  1728. }
  1729.  
  1730. ---------------------------
  1731.  
  1732. >From david@interport.net (David)
  1733. Subject: Oh where has my CODE 0 gone?
  1734. Date: 6 Jan 1996 17:19:54 -0500
  1735. Organization: Interport Communications Corp.
  1736.  
  1737. I've noticed that CODE 0 never seems to be present in an application's
  1738. heap. (Is this in fact universally true?) I've tried making it protected,
  1739. preloading, and locked in Resedit, but it still doesn't show up. Where
  1740. does this elusive little resource go when it's loaded? How do you
  1741. find it in Macsbug? (I'm specifically trying to view the CODE 0 of 
  1742. an application while it's running.) Thanks for any suggestions! 
  1743.  
  1744. Dave :)
  1745.  
  1746. +++++++++++++++++++++++++++
  1747.  
  1748. >From Matt Slot <fprefect@umich.edu>
  1749. Date: 7 Jan 1996 23:28:56 GMT
  1750. Organization: University of Michigan
  1751.  
  1752. David, david@interport.net writes:
  1753.  > I've noticed that CODE 0 never seems to be present in an application's
  1754.  > heap. (Is this in fact universally true?) I've tried making it protected,
  1755.  > preloading, and locked in Resedit, but it still doesn't show up. Where
  1756.  > does this elusive little resource go when it's loaded? How do you
  1757.  > find it in Macsbug? (I'm specifically trying to view the CODE 0 of 
  1758.  > an application while it's running.) Thanks for any suggestions! 
  1759.  
  1760. CODE 0 is the Jump Table, and gets loaded just above A5 (app globals
  1761. reside below A5), and stays resident throughout the applications
  1762. execution. Remember that all other CODE resources may be loaded or
  1763. unloaded at any time (well, not the currently executing one), since
  1764. the Jump Table entry actually loads the resource on demand.
  1765.  
  1766. Check out the Segment Loader chapter in NIM:Processes for more 
  1767. information.
  1768.  
  1769. Matt
  1770.  
  1771. * * * * * * * * * * * * * * * * * * * * * * * * * * ======================
  1772. *  Reality: Matt Slot                             *  Time is an illusion.
  1773. *  E-Mail:  mailto:fprefect@umich.edu             *  Lunchtime doubly so.
  1774. *  Web:     http://www.sils.umich.edu/~fprefect/  *     -- Douglas Adams
  1775. * * * * * * * * * * * * * * * * * * * * * * * * * * ======================
  1776.  
  1777. +++++++++++++++++++++++++++
  1778.  
  1779. >From Patrick.Stadelmann@etudiants.unine.ch (Patrick Stadelmann)
  1780. Date: Mon, 08 Jan 1996 10:15:27 +0100
  1781. Organization: University of Neuchatel
  1782.  
  1783. In article <4cmsia$alm@interport.net>, david@interport.net (David) wrote:
  1784.  
  1785. > I've noticed that CODE 0 never seems to be present in an application's
  1786. > heap. (Is this in fact universally true?) I've tried making it protected,
  1787. > preloading, and locked in Resedit, but it still doesn't show up. Where
  1788. > does this elusive little resource go when it's loaded? How do you
  1789. > find it in Macsbug? (I'm specifically trying to view the CODE 0 of 
  1790. > an application while it's running.) Thanks for any suggestions! 
  1791.  
  1792. The CODE 0 is the jump table. You can display it in MacsBug by
  1793. typing "jumptable" (or something like that). I believe that the
  1794. content of the resource is copied in the correct memory location
  1795. (at a5+$20), then the resource is released.
  1796.  
  1797. Patrick
  1798.  
  1799. -- 
  1800. Patrick Stadelmann <Patrick.Stadelmann@etudiants.unine.ch>
  1801.  
  1802. +++++++++++++++++++++++++++
  1803.  
  1804. >From CatGuy@lamg.com (Milo Shiff)
  1805. Date: 09 Jan 1996 02:55:29 GMT
  1806. Organization: Los Angeles Macintosh Group BBS
  1807.  
  1808. In message ID <4cmsia$alm@interport.net> on 1/6/96, David wrote:
  1809.  
  1810. D> I've noticed that CODE 0 never seems to be present in an application's
  1811. D> heap. (Is this in fact universally true?) I've tried making it protected,
  1812. D> preloading, and locked in Resedit, but it still doesn't show up. Where
  1813. D> does this elusive little resource go when it's loaded? How do you
  1814. D> find it in Macsbug? (I'm specifically trying to view the CODE 0 of 
  1815. D> an application while it's running.) Thanks for any suggestions!
  1816.  
  1817.    CODE zero exists as information for the OS in setting up the application
  1818. heap and the A5 relative items.
  1819.  
  1820. - via BulkRate 2.1
  1821.  
  1822. +++++++++++++++++++++++++++
  1823.  
  1824. >From CatGuy@lamg.com (Milo Shiff)
  1825. Date: 10 Jan 1996 03:08:22 GMT
  1826. Organization: Los Angeles Macintosh Group BBS
  1827.  
  1828. Matt Slot,fprefect@umich.edu,Internet SAID:
  1829.  
  1830. <<<Remember that all other CODE resources may be loaded or
  1831. unloaded at any time (well, not the currently executing one)>>>
  1832.  
  1833.    Well, actually you CAN unload the currently executing CODE segment -- a
  1834. mistake I made in a program a few years back, with predictably adverse
  1835. results....
  1836.  
  1837.  
  1838. ---------------------------
  1839.  
  1840. >From wrrj@pobox.com (William Rose)
  1841. Subject: The Required Apple Events (i.e. are they)
  1842. Date: Tue, 09 Jan 1996 18:48:07 +1100
  1843. Organization: W.R.R.J. Incorporated
  1844.  
  1845.    I have not done much programming with apple events yet, but I know that
  1846. good people implement handlers for four of them, (from memory) 'oapp',
  1847. 'odoc', 'pdoc' and 'quit'.  I understand the purpose of the quit event.
  1848.    Question 1:
  1849.    i)  Given the above, in an application that creates no files is it
  1850. necessary to implement 'odoc' & 'pdoc'?
  1851.    ii) In an application that doesn't support printing, is it necessary to
  1852. support 'pdoc'?
  1853.    Question 2:
  1854.    What on earth is the point of the 'oapp' event?  I figure, you're
  1855. program opens (from finder, LaunchApplication call or something).  For C
  1856. programmers, main is entered and things start rolling.  You do your
  1857. initialisation, set up apple event handlers, etc and then go into the
  1858. major event loop.  Why do you need a separate event to tell you 'in case
  1859. you hadn't noticed, you were just opened.'?  It shouldn't be to do
  1860. activate/deactivate stuff, there are perfectly good event manager events
  1861. for that.  Please, somebody, why?
  1862.  
  1863. Thanks for reading,
  1864.    William Rose
  1865.  
  1866. +++++++++++++++++++++++++++
  1867.  
  1868. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  1869. Date: 9 Jan 1996 16:31:49 GMT
  1870. Organization: National Renewable Energy Laboratory
  1871.  
  1872. In article <wrrj-0901961848070001@slmel1p50.ozemail.com.au> William
  1873. Rose, wrrj@pobox.com writes:
  1874.  
  1875. >   I have not done much programming with apple events yet, but I know that
  1876. >good people implement handlers for four of them, (from memory) 'oapp',
  1877. >'odoc', 'pdoc' and 'quit'.  I understand the purpose of the quit event.
  1878. >   Question 1:
  1879. >   i)  Given the above, in an application that creates no files is it
  1880. >necessary to implement 'odoc' & 'pdoc'?
  1881.  
  1882. Does the app open files?  If so, you will need to handle the odoc event.
  1883.  
  1884. >   ii) In an application that doesn't support printing, is it necessary to
  1885. >support 'pdoc'?
  1886.  
  1887. If this is just a quick program for testing something that will never
  1888. see the light of day, you can certainly get by without them.  But real
  1889. applications should because if they aren't there, the Finder goes
  1890. through some machinations to simulate them.  Also, they are really easy
  1891. to implement, even if they are never called.  I just do something like
  1892. this (the handler has to installed, of course):
  1893.  
  1894. static pascal OSErr handle_pdoc_apple_event
  1895.   (AppleEvent *message, AppleEvent *reply, long refcon)
  1896.   {
  1897.     return( all_required_params_extracted(message) );
  1898.   }  // handle_pdoc_apple_event
  1899.   
  1900. OSErr all_required_params_extracted (AppleEvent *message)
  1901.   {
  1902.     OSErr    result;
  1903.     DescType  returned_type;
  1904.     Size    actual_size;
  1905.     
  1906.     result = AEGetAttributePtr
  1907.         (message, keyMissedKeywordAttr, typeWildCard,
  1908.          &returned_type, nil, 0, &actual_size);
  1909.     switch (result)
  1910.       {
  1911.         case errAEDescNotFound:
  1912.           return(noErr);
  1913.         case noErr:
  1914.           return(errAEEventNotHandled);
  1915.         default:
  1916.           return(result);
  1917.       }
  1918.   }  // all_required_params_extracted
  1919.  
  1920. >   Question 2:
  1921. >   What on earth is the point of the 'oapp' event?  I figure, you're
  1922. >program opens (from finder, LaunchApplication call or something).  
  1923.  
  1924. The oapp is how the Finder tells your application how it was opened. If
  1925. a file belonging to your app was double-clicked (or opened from the File
  1926. menu in the Finder), the app receives an odoc event.  If the application
  1927. itself was opened without a file, the Finder sends an oapp event.
  1928.  
  1929. Hope this helps.
  1930.  
  1931. +++++++++++++++++++++++++++
  1932.  
  1933. >From "Andrew C. Plotkin" <erkyrath+@CMU.EDU>
  1934. Date: Tue,  9 Jan 1996 12:14:23 -0500
  1935. Organization: Carnegie Mellon, Pittsburgh, PA
  1936.  
  1937. wrrj@pobox.com (William Rose) writes:
  1938. >    I have not done much programming with apple events yet, but I know that
  1939. > good people implement handlers for four of them, (from memory) 'oapp',
  1940. > 'odoc', 'pdoc' and 'quit'.  I understand the purpose of the quit event.
  1941. >    Question 1:
  1942. >    i)  Given the above, in an application that creates no files is it
  1943. > necessary to implement 'odoc' & 'pdoc'?
  1944.  
  1945. You should probably install handlers for them, but it's ok if the
  1946. handlers do nothing.
  1947.  
  1948. >    ii) In an application that doesn't support printing, is it necessary to
  1949. > support 'pdoc'?
  1950.  
  1951. Yes. You should at least have a handler which puts up a dialog which
  1952. reads "TwiddleStar documents cannot be printed. Sorry."
  1953.  
  1954. >    Question 2:
  1955. >    What on earth is the point of the 'oapp' event?  
  1956.  
  1957. The OApp event is *only* received when your application is run by
  1958. itself. You do *not* get an OApp if your application is launched
  1959. because someone double-clicked (or printed) a document.
  1960.  
  1961. The typical thing to do when you get OApp is create an empty document
  1962. called "Untitled". 
  1963.  
  1964. --Z
  1965.  
  1966. "And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."
  1967.  
  1968. +++++++++++++++++++++++++++
  1969.  
  1970. >From isis@netcom.com (Mike Cohen)
  1971. Date: Tue, 09 Jan 1996 10:32:13 -0600
  1972. Organization: ISIS International
  1973.  
  1974. In article <wrrj-0901961848070001@slmel1p50.ozemail.com.au>,
  1975. wrrj@pobox.com (William Rose) wrote:
  1976.  
  1977. >   I have not done much programming with apple events yet, but I know that
  1978. >good people implement handlers for four of them, (from memory) 'oapp',
  1979. >'odoc', 'pdoc' and 'quit'.  I understand the purpose of the quit event.
  1980. >   Question 1:
  1981. >   i)  Given the above, in an application that creates no files is it
  1982. >necessary to implement 'odoc' & 'pdoc'?
  1983. >   ii) In an application that doesn't support printing, is it necessary to
  1984. >support 'pdoc'?
  1985.  
  1986. In those cases, it's OK not to handle those events.
  1987.  
  1988. >   Question 2:
  1989. >   What on earth is the point of the 'oapp' event?  I figure, you're
  1990. >program opens (from finder, LaunchApplication call or something).  For C
  1991. >programmers, main is entered and things start rolling.  You do your
  1992. >initialisation, set up apple event handlers, etc and then go into the
  1993. >major event loop.  Why do you need a separate event to tell you 'in case
  1994. >you hadn't noticed, you were just opened.'?  It shouldn't be to do
  1995. >activate/deactivate stuff, there are perfectly good event manager events
  1996. >for that.  Please, somebody, why?
  1997. >
  1998.  
  1999. 'oapp' is sent when your application is double-clicked without a document
  2000. (as opposed to 'odoc', which is sent when a document is double-clicked). In
  2001. most cases, you should do the appropriate thing for that case, such as
  2002. opening a new untitled document.
  2003.  
  2004.  
  2005. --
  2006. Mike Cohen - isis@isis-intl.com
  2007. Home Page: http://www.isis-intl.com/
  2008. Sound is the same for all the world - Youssou N'dour, "Eyes Open"
  2009. *** Save Mystery Science Theater 3000! Comedy Central has decided to
  2010. *** cancel it. Call them at (212) 767-8600 and tell them what you think.
  2011. *** Full details at http://fermi.clas.virginia.edu/~jcp9j/canceled.html
  2012.  
  2013. +++++++++++++++++++++++++++
  2014.  
  2015. >From deslee@bright.net (Des Courtney)
  2016. Date: Tue, 09 Jan 1996 23:51:58 -0500
  2017. Organization: Flair Diversions
  2018.  
  2019. In article <wrrj-0901961848070001@slmel1p50.ozemail.com.au>,
  2020. wrrj@pobox.com (William Rose) wrote:
  2021.  
  2022. )    Question 2:
  2023. )    What on earth is the point of the 'oapp' event?
  2024. [snip]
  2025.  
  2026. One reason "Open Application" exists is as a way to determine if the
  2027.   application was opened directly or via opening a document.  "odoc"
  2028.   events are sent before the "oapp" event if the program is launched
  2029.   with documents.  You can then use the "odoc" handler to cause
  2030.   different actions to occur based on this.
  2031.  
  2032. A common trick for "drag-on" and "helper" apps is to keep the
  2033.   program running after a direct launch, but to auto-quit when
  2034.   opening documents are manipulated.  In this case, the "oapp"
  2035.   handler would send a "quit" event if it detected that a "odoc"
  2036.   event was received first.
  2037.  
  2038. Hope this makes sense,
  2039.  
  2040. Des Courtney
  2041.  
  2042. -- 
  2043. Flair Diversions is... Des Courtney, writer of cool Mac software
  2044.          Outpost Nexus, Ambiance, Icons for MICN, etc.
  2045.                    mailto:deslee@bright.net
  2046.                Obligatory ASCII graphic --> (-;
  2047.  
  2048. +++++++++++++++++++++++++++
  2049.  
  2050. >From deirdre@sover.net (Deirdre)
  2051. Date: Wed, 10 Jan 1996 10:24:00 -0500
  2052. Organization: Hah!
  2053.  
  2054. I always support all four required events even in teensy little
  2055. applications that have no documents. I just make 'odoc' and 'pdoc' an
  2056. empty function.
  2057.  
  2058. For the oapp event, you may want to do some specific initialization. Other
  2059. than that, I don't "get" why it's there either. I just make that an empty
  2060. function too. It is in theory possible that you wil get this event after
  2061. your app has been running for some time.
  2062.  
  2063. I suspect that the 'oapp' event may be for future compatibility, which is
  2064. why I always support it.
  2065.  
  2066. _Deirdre
  2067.  
  2068. In article <wrrj-0901961848070001@slmel1p50.ozemail.com.au>,
  2069. wrrj@pobox.com (William Rose) wrote:
  2070.  
  2071. > I have not done much programming with apple events yet, but I know that
  2072. > good people implement handlers for four of them, (from memory) 'oapp',
  2073. > 'odoc', 'pdoc' and 'quit'.  I understand the purpose of the quit event.
  2074. >    Question 1:
  2075. >    i)  Given the above, in an application that creates no files is it
  2076. > necessary to implement 'odoc' & 'pdoc'?
  2077. >    ii) In an application that doesn't support printing, is it necessary to
  2078. > support 'pdoc'?
  2079. >    Question 2:
  2080. >    What on earth is the point of the 'oapp' event?  I figure, you're
  2081. > program opens (from finder, LaunchApplication call or something).  For C
  2082. > programmers, main is entered and things start rolling.  You do your
  2083. > initialisation, set up apple event handlers, etc and then go into the
  2084. > major event loop.  Why do you need a separate event to tell you 'in case
  2085. > you hadn't noticed, you were just opened.'?  It shouldn't be to do
  2086. > activate/deactivate stuff, there are perfectly good event manager events
  2087. > for that.  Please, somebody, why?
  2088.  
  2089. +++++++++++++++++++++++++++
  2090.  
  2091. >From 75103.761@compuserve.com (Jeffrey Kraus)
  2092. Date: Fri, 12 Jan 1996 22:55:12 -0800
  2093. Organization: Berbee Information Networks Corporation
  2094.  
  2095. In article <deirdre-1001961024000001@pm0a24.bf.sover.net>,
  2096. deirdre@sover.net (Deirdre) wrote:
  2097.  
  2098. > I always support all four required events even in teensy little
  2099. > applications that have no documents. I just make 'odoc' and 'pdoc' an
  2100. > empty function.
  2101. > For the oapp event, you may want to do some specific initialization. Other
  2102. > than that, I don't "get" why it's there either. I just make that an empty
  2103. > function too. It is in theory possible that you wil get this event after
  2104. > your app has been running for some time.
  2105. > I suspect that the 'oapp' event may be for future compatibility, which is
  2106. > why I always support it.
  2107.  
  2108. I have my program use the 'oapp' to check it's preference file and open
  2109. the last file that was opened. If the program receives an 'odoc' it opens
  2110. the specified file.
  2111.  
  2112. I do this since my program only views documents and does not create them
  2113. and is only usefull when a document is open.
  2114.  
  2115. +++++++++++++++++++++++++++
  2116.  
  2117. >From dnebing@epix.net (Dave Nebinger)
  2118. Date: Mon, 15 Jan 1996 14:21:51 -0500
  2119. Organization: KHP Services, Inc
  2120.  
  2121. In article <75103.761-1201962255120001@msn_3_1.binc.net>,
  2122. 75103.761@compuserve.com (Jeffrey Kraus) wrote:
  2123.  
  2124. > In article <deirdre-1001961024000001@pm0a24.bf.sover.net>,
  2125. > deirdre@sover.net (Deirdre) wrote:
  2126. > > I always support all four required events even in teensy little
  2127. > > applications that have no documents. I just make 'odoc' and 'pdoc' an
  2128. > > empty function.
  2129. > > 
  2130.  
  2131. If an app doesn't support printing, shouldn't you *not* include a pdoc handler
  2132. to have the apple event manager return the errAEEventNotHandled error?  Why
  2133. make a script or AE-aware application think that you successfully handled
  2134. an event that you don't or can't handle?
  2135.  
  2136. > > For the oapp event, you may want to do some specific initialization. Other
  2137. > > than that, I don't "get" why it's there either. I just make that an empty
  2138. > > function too. It is in theory possible that you wil get this event after
  2139. > > your app has been running for some time.
  2140. > > 
  2141. > > I suspect that the 'oapp' event may be for future compatibility, which is
  2142. > > why I always support it.
  2143. > > 
  2144. > I have my program use the 'oapp' to check it's preference file and open
  2145. > the last file that was opened. If the program receives an 'odoc' it opens
  2146. > the specified file.
  2147.  
  2148. The IM:IAC says that 'oapp's should do what a non-AE aware app would do
  2149. when it starts up (i.e. open a new document window if a text editor, etc.).
  2150.  
  2151. A recent addition to the registry for the AppleScript suite is a 'No Operation'
  2152. event which should do nothing on application launch.  From the AppleScript
  2153. Suite document:
  2154.  
  2155. "The No Operation event can be used as an alternative to the standard launch
  2156. events sent by the Finder: Open Application, Open Documents, and Print
  2157. Documents.  It indicates that the application is being launched by a script,
  2158. which will subsequently send more events.  There are two reasons for the
  2159. No Operation event: 1> From a scripting point of view, most applications perform
  2160. undesireable actions when they receive the standard Open Application event.  For
  2161. example, they open a new document, or display a modal dialog waiting for
  2162. user response.  2) The event an application is launched with cannoth have a
  2163. reply, thus no erros are returned to the script.  No Operation event, when used
  2164. for launching, will avoid the standard double-click behavior, and allow
  2165. subsequent events to return error replies."
  2166.  
  2167. Dave.
  2168.  
  2169. ==========================================================
  2170. Dave Nebinger                             dnebing@epix.net
  2171.              The Alt.Sources.Mac Archivist
  2172.  
  2173. +++++++++++++++++++++++++++
  2174.  
  2175. >From clw95002@uconnvm.uconn.edu (Chris Waskowich)
  2176. Date: 12 Jan 1996 16:14:22 GMT
  2177. Organization: University of Connecticut
  2178.  
  2179. In article <wrrj-0901961848070001@slmel1p50.ozemail.com.au>,
  2180. wrrj@pobox.com (William Rose) wrote:
  2181.  
  2182. >    Question 2:
  2183. >    What on earth is the point of the 'oapp' event?
  2184.  
  2185.  
  2186.  
  2187. I have an app that I wrote, this is what happens:
  2188.  
  2189. case 1:  If I double  click the app, it opens with the standard open
  2190. dialog.  I do this thorugh 'oapp'.
  2191.  
  2192. case 2:  I drop a file on my app, but I really don't feel like getting the
  2193. standard open dialog box, so it just opens the file instead.
  2194.  
  2195.  
  2196. Other than that I have no clue what else you wuld use it for...
  2197.  
  2198.  
  2199.  
  2200. Chris Waskowich
  2201.  
  2202.  
  2203. ---------------------------
  2204.  
  2205. >From grinch@ns.moran.com (The Grinch)
  2206. Subject: Turning on Sharing
  2207. Date: Fri, 05 Jan 1996 17:59:10 -0500
  2208. Organization: Vortex Software
  2209.  
  2210. I am writing a big old installer and a half. It runs local on each 
  2211. computer in a lab, logs onto a central server or two, and basically copies 
  2212. most of the server's HD. In this way we can set up the lab unattended over 
  2213. night.
  2214.  
  2215. MY PROBLEM IS THIS:
  2216.   I'd like to be able to automate the setting of access privs and the 
  2217. configuring of share points (shared directories). However, it seems (by 
  2218. the errors I get) that I'm not allowed to establish share points when file 
  2219. sharing is off. So how do I turn the silly thing on? Vinfo? PRAM? I'd 
  2220. really be grateful for some code, but please drop me a line if you just 
  2221. know where the info is stored.
  2222.   Also, if anybody has a chunk of code to copy access privs from one 
  2223. folder to another, please post it! It would save me quite a bit of work.
  2224.  
  2225. Please e-mail your replies. And thanx for the help!
  2226.  
  2227. -The Grinch
  2228.  
  2229. +++++++++++++++++++++++++++
  2230.  
  2231. >From zobkiw@triplesoft.com (Joe Zobkiw)
  2232. Date: Sun, 07 Jan 1996 08:53:16 -0500
  2233. Organization: TripleSoft Inc.
  2234.  
  2235. In article <grinch-0501961759100001@nw53.moran.com>, grinch@ns.moran.com
  2236. (The Grinch) wrote:
  2237.  
  2238. >I am writing a big old installer and a half. It runs local on each 
  2239. >computer in a lab, logs onto a central server or two, and basically copies 
  2240. >most of the server's HD. In this way we can set up the lab unattended over 
  2241. >night.
  2242.  
  2243. I presume you've looked at the programs that exist to do this already.
  2244. Just in case one of them works for you, you wouldn't have to re-invent the
  2245. wheel.
  2246.  
  2247. >MY PROBLEM IS THIS:
  2248. >  I'd like to be able to automate the setting of access privs and the 
  2249. >configuring of share points (shared directories). However, it seems (by 
  2250. >the errors I get) that I'm not allowed to establish share points when file 
  2251. >sharing is off. So how do I turn the silly thing on? Vinfo? PRAM? I'd 
  2252. >really be grateful for some code, but please drop me a line if you just 
  2253. >know where the info is stored.
  2254.  
  2255. You simply launch the File Sharing faceless-background-application using
  2256. LaunchApplication(...). That is how you start it. To quit it, simply send
  2257. it a 'quit' AppleEvent.
  2258.  
  2259. >  Also, if anybody has a chunk of code to copy access privs from one 
  2260. >folder to another, please post it! It would save me quite a bit of work.
  2261.  
  2262. Look for MoreFiles (1.4 is the latest)...you can get it from here
  2263. <ftp://users.aol.com/jumplong/MoreFiles_1.4.sea.bin>
  2264.  
  2265. Good luck!
  2266.  
  2267. Joe Zobkiw                         <mailto:zobkiw@triplesoft.com>
  2268. TripleSoft Inc.                      <http://www.triplesoft.com/>
  2269. Specializing in Custom Macintosh Software Development & Solutions
  2270. - ---------------------------------------------------------------
  2271. Macintosh programmers! Check out "A Fragment of Your Imagination"
  2272.    from Addison-Wesley <http://www.triplesoft.com/fragment/>
  2273.  
  2274. +++++++++++++++++++++++++++
  2275.  
  2276. >From jumplong@aol.com (Jump Long)
  2277. Date: 7 Jan 1996 14:54:35 -0500
  2278. Organization: America Online, Inc. (1-800-827-6364)
  2279.  
  2280. Joe Zobkiw responded to The Grinch with:
  2281. >>MY PROBLEM IS THIS:
  2282. >>  I'd like to be able to automate the setting of access privs and the 
  2283. >>configuring of share points (shared directories). However, it seems (by 
  2284. >>the errors I get) that I'm not allowed to establish share points when
  2285. file 
  2286. >>sharing is off. So how do I turn the silly thing on? Vinfo? PRAM? I'd 
  2287. >>really be grateful for some code, but please drop me a line if you just 
  2288. >>know where the info is stored.
  2289. >
  2290. >You simply launch the File Sharing faceless-background-application using
  2291. >LaunchApplication(...). That is how you start it. To quit it, simply send
  2292. >it a 'quit' AppleEvent.
  2293.  
  2294. Really, you should use the Server Control call SCStartServer. Get the
  2295. AppleShare API from Apple's Mac OS SDK CD-ROM - there's sample code with
  2296. the SDK that shows how to do that.
  2297.  
  2298. The source code for UnmountIt and Server Remote Control (two programs I
  2299. wrote) also shows how to call SCStartServer. You can download the source
  2300. code for UnmountIt at:
  2301.  
  2302. ftp://sam.austin.apple.com/Apple.Support.Area/Developer_Services/Tool_Ches
  2303. t/Files/UnmountIt_1.2.sit.hqx
  2304.  
  2305. and Server Romote Control can be obtained from:
  2306.  
  2307. ftp://sam.austin.apple.com/Apple.Support.Area/Developer_Services/Tool_Ches
  2308. t/Interapplication_Communication/Server_Remote_Control_1.1/Server_Remote_Co
  2309. ntrol_1.1.sit.hqx
  2310.  
  2311. >>  Also, if anybody has a chunk of code to copy access privs from one 
  2312. >>folder to another, please post it! It would save me quite a bit of work.
  2313. >
  2314. >Look for MoreFiles (1.4 is the latest)...you can get it from here
  2315. ><ftp://users.aol.com/jumplong/MoreFiles_1.4.sea.bin>
  2316.  
  2317. Actually, you'll want toget MoreFiles 1.4.1 which I released last night
  2318. from:
  2319.  
  2320. ftp://members.aol.com/JumpLong/MoreFiles 1.4.1.sea.hqx
  2321.  
  2322. You can use the routine CopyDirectoryAccess to do that. The
  2323. CopyDirectoryAccess function copies the AFP directory access privileges
  2324. from one directory to another. Both directories *must* be on the same file
  2325. server, but not necessarily on the same server volume.  Why? Because if
  2326. the volumes are on different servers, there's no way you can guarantee
  2327. that the user on server "A" with the name "Jim Luther" is the same user as
  2328. the user on server "B" named "Jim Luther", so I don't let you make that
  2329. assumption with CopyDirectoryAccess.
  2330.  
  2331. - Jim Luther
  2332.  
  2333. ---------------------------
  2334.  
  2335. >From jumplong@aol.com (Jump Long)
  2336. Subject: [ANN] MoreFiles v1.4.1 now available
  2337. Date: 7 Jan 1996 04:08:57 -0500
  2338. Organization: America Online, Inc. (1-800-827-6364)
  2339.  
  2340. [ANN] MoreFiles v1.4.1 now available
  2341.  
  2342. Don't you hate it when you rush to beat a deadline and miss a couple of
  2343. stupid bugs? I know I do because I have to release an update. In my case,
  2344. I rushed MoreFiles 1.4 out the door to make it available before the
  2345. holidays... and then started receiving bug reports.
  2346.  
  2347. I've fixed all bugs reported (and rechecked my other 1.4 changes), so
  2348. MoreFiles 1.4.1 is now available at:
  2349.  
  2350.   ftp://members.aol.com/JumpLong/MoreFiles 1.4.1.sea.hqx
  2351.  
  2352. I've pasted the release notes for MoreFile 1.4.1 in case you're wondering
  2353. what didn't work.
  2354.  
  2355. Happy New Year!
  2356.  
  2357. Jim Luther
  2358. JumpLong@aol.com
  2359. ________________________________________
  2360.  
  2361. v1.4.1  1/6/96
  2362.  
  2363. Bugs fixed:
  2364. *  Fixed the conditionalized code FSpCreateCompat.
  2365. *  Fixed the conditionalized code FSpExchangeFilesCompat.
  2366. *  Fixed the conditionalized code FSpCreateResFileCompat.
  2367.  
  2368. Other changes:
  2369. *  Changed PBStatus(&pb, false) to PBStatusSync(&pb) in GetDiskBlocks.
  2370.  
  2371.  
  2372. ---------------------------
  2373.  
  2374. End of C.S.M.P. Digest
  2375. **********************
  2376.  
  2377.  
  2378. Attachment converted: Webworm:BackgroundClicks.p (TEXT/PJMM) (0002639A)
  2379.